Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * BaseController Controller (V1.0):
- *
- *
- * @author
- */
- sap.ui.define([
- "sap/ui/core/mvc/Controller",
- "sap/ui/core/routing/History"
- ], function(Controller, History) {
- "use strict";
- /* Maria Elise Martin inserted the following code 11/10/16 */
- var woundParam;
- /* Maria Elise Martin end of change 11/10/16 */
- return Controller.extend("FS_WS_PDM_DEMO.controller.common.BaseController", {
- /**
- * Getter for the Controlers Model
- * Can be used to add/access any controller from the other app controllers
- *
- * @author
- */
- getControllersModel: function() {
- return sap.ui.getCore().getModel("controllers").getData();
- },
- /**
- * Setter for the Controlers Model
- * Can be used to add/access any controller from the other app controllers
- *
- * @author
- */
- setControllersModel: function(sControllers) {
- var oControlModel = new sap.ui.model.json.JSONModel(sControllers);
- sap.ui.getCore().setModel(oControlModel, "controllers");
- },
- /**
- * Function that opens sidebar menu
- *
- * @author
- */
- openMenu: function() {
- var oShell = this.getControllersModel().app.getView().byId("ushell");
- //var oShell = this.getRouter().getView("FS_WS_PDM_DEMO.view.dashboard.Main").getParent().getParent().getParent();
- //var oShell = window.appController.getView().byId("ushell");
- var bState = oShell.getShowPane();
- oShell.setShowPane(!bState);
- /*if (!bState) {
- var blocklayer = new sap.ui.xmlfragment("FS_WS_PDM_DEMO.fragment.common.blocklayer", this);
- this.getView().byId("homepage").addContent(blocklayer);
- } else {
- jQuery.sap.delayedCall(500, this, function() {
- this.getView().byId("homepage").removeContent(this.getView().byId("homepage").getContent().length - 1);
- });
- }*/
- },
- /**
- * Navigation function used to navigate to previous page
- *
- * @author
- */
- onNavBackReturn: function() {
- var bRes;
- var oHistory = History.getInstance();
- var sPreviousHash = oHistory.getPreviousHash();
- if (sPreviousHash !== undefined) {
- window.history.go(-1);
- bRes = true;
- } else {
- // this.getRouter().navTo("Main", true);
- bRes = false;
- }
- return bRes;
- },
- /**
- * Default function to expand and retract panels
- * Does nothing if the arrow is pointing to the right (navigation arrow)
- *
- * @author
- */
- toggleExpandablePanel: function(oEvent) {
- var oBtn = oEvent.getSource();
- //do not expand if btn is used to navigate to next page (right arrow icon)
- if (oBtn.getIcon() !== "sap-icon://slim-arrow-right") {
- var oPanel = oBtn.getParent().getParent().getParent().getParent();
- var isExpanded = oPanel.getExpanded();
- if (isExpanded) oBtn.setIcon("sap-icon://slim-arrow-down");
- else oBtn.setIcon("sap-icon://slim-arrow-up");
- oPanel.setExpanded(!isExpanded);
- } else {
- //use this function on the respective controller
- try {
- this.togglePanelNavigation();
- } catch (e) {
- //function not defined
- }
- }
- },
- /**
- * Function that deletes the "edit" icon from the panel and changes
- * the expand btn to become a "navigation arrow"
- *
- * @author
- */
- setNavigationArrow: function(oPanel) {
- var oFlex = oPanel.getHeaderToolbar().getContent()[0].getItems()[2];
- var oEditicon = oFlex.getItems()[0];
- var oExpandbtn = oFlex.getItems()[1];
- oFlex.setJustifyContent("Center");
- oEditicon.destroy();
- oExpandbtn.setIcon("sap-icon://slim-arrow-right");
- },
- /**
- * Navigation function used to navigate to previous page,
- * or Home page in case that doesnt exists
- *
- * @author
- */
- onNavBack: function() {
- var oHistory = History.getInstance();
- var sPreviousHash = oHistory.getPreviousHash();
- if (sPreviousHash !== undefined) {
- window.history.go(-1);
- } else {
- this.getRouter().navTo("Main", true);
- }
- },
- /**
- * Navigation function used to navigate to Home page
- *
- * @author
- */
- navHome: function() {
- this.getRouter().navTo("Main");
- },
- /**
- * Navigation function used to navigate to Discharge page
- *
- * @author
- */
- navToDischarge: function() {
- this.getRouter().navTo("Discharge");
- },
- /**
- * Navigation function used to navigate to Therapy page
- *
- * @author
- */
- navToTherapy: function() {
- this.getRouter().navTo("Therapy");
- },
- /**
- * Navigation function used to navigate to WVDocuments page
- *
- * @author
- */
- navToWVDocuments: function() {
- this.getRouter().navTo("WVDocuments");
- },
- /**
- * Navigation function used to navigate to WVTherapy page
- *
- * @author
- */
- navToWVTherapy: function(sWound) {
- this.getRouter().navTo("WVTherapy", {
- wound: sWound
- });
- },
- //Start - DHC-1588 - Code Insert - Maridine Reyes - 12-15-2016
- navToWoundOverview: function(){
- this.getRouter().navTo("WoundOverview");
- },
- //End - DHC-1588 - Code Insert - Maridine Reyes - 12-15-2016
- /* Ruther So Start of change 01/04/2017 */
- navToStatusUpdateEnteralNutrition: function() {
- this.getRouter().navTo("StatusUpdateEnteralNutrition");
- },
- /* Ruther So End of change 01/04/2017 */
- /* Elray Jun Amplayo Start of change 01/05/2017 */
- navToEnterDiagnosis: function() {
- this.getRouter().navTo("EnterDiagnosis");
- },
- /* Elray Jun Amplayo End of change 01/05/2017 */
- /*
- * Navigation functions: used to navigate to different pages
- */
- /* Jj Kida start of change 11/17/16 */
- /**
- * Navigation function used to navigate to MedicalAssessment1 page
- * according to the string wound received
- *
- * @author
- */
- navToMedical1: function(sWound) {
- this.getRouter().navTo("MedicalAssessment1", {
- wound: sWound
- });
- },
- /**
- * Navigation function used to navigate to MedicalAssessment2 page
- * according to the string wound received
- *
- * @author
- */
- navToMedical2: function(sWound) {
- this.getRouter().navTo("MedicalAssessment2", {
- wound: sWound
- });
- },
- /**
- * Navigation function used to navigate to MedicalAssessment3 page
- * according to the string wound received
- *
- * @author
- */
- navToMedical3: function(sWound) {
- this.getRouter().navTo("MedicalAssessment3", {
- wound: sWound
- });
- },
- /**
- * Navigation function used to navigate to MedicalAssessment4 page
- * according to the string wound received
- *
- * @author
- */
- navToMedical4: function(sWound) {
- this.getRouter().navTo("MedicalAssessment4", {
- wound: sWound
- });
- },
- /* Jj Kida end of change 11/17/16 */
- /**
- * Navigation function used to navigate to OrderConfirmation page
- * according to the object property and integer index received
- *
- * @author
- */
- navToOrderConfirmation: function(oProperty, iIndex) {
- this.getRouter().navTo("OrderConfirmation", {
- property: oProperty,
- index: iIndex
- });
- },
- /**
- * Navigation function used to navigate to ShoppingCart page
- * according to the object property and integer index received
- *
- * @author
- */
- navToShoppingCart: function(oProperty, iIndex) {
- this.getRouter().navTo("ShoppingCart", {
- property: oProperty,
- index: iIndex
- });
- },
- /**
- * Navigation function used to navigate to Overview page
- *
- * @author
- */
- navToOverview: function() {
- this.getRouter().navTo("Overview");
- },
- /**
- * Navigation function used to call the navToOverview function
- *
- * @author
- */
- navToOverviewViaSidebar: function() {
- this.openMenu();
- this.navToOverview();
- },
- /**
- * Navigation function used to navigate to PrefilledPrescription page
- * according to the object button, object property and integer index received
- *
- * @author
- */
- navToPrefilledPrescription: function(oButton, oProperty, iIndex) {
- this.getRouter().navTo("PrefilledPrescription", {
- button: oButton,
- property: oProperty,
- index: iIndex
- });
- },
- /**
- * Navigation function used to navigate to WVStatus page
- * according to the string wound received
- *
- * @author
- */
- navToWVStatus: function(sWound) {
- this.getRouter().navTo("WVStatus", {
- wound: sWound
- });
- },
- /**
- * Navigation function used to navigate to WVTherapyEdit page
- * according to the string wound and additional received
- *
- * @author
- */
- navToWVTherapyEdit: function(sWound, sAdditional) {
- this.getRouter().navTo("WVTherapyEdit", {
- wound: sWound,
- additional: sAdditional
- });
- },
- /**
- * Navigation function used to navigate to previous Therapy
- * document according to the history
- *
- * @author
- */
- therapyNavBack: function() {
- var oHistory = History.getInstance();
- //var sPreviousHash = window.hasher.getHashAsArray()[0];
- var sPreviousHash = oHistory.getPreviousHash();
- if (/WVDocuments/.test(sPreviousHash)) {
- this.navToWVDocuments();
- } else if (sPreviousHash === "Therapy") {
- this.navToTherapy();
- } else {
- //default
- this.navToTherapy();
- }
- },
- /**
- * Navigation function used to navigate to PatientRequest page
- *
- * @author
- */
- navToPatientRequest: function() {
- this.getRouter().navTo("PatientRequest");
- },
- /**
- * Navigation function used to navigate to Medical device page
- *
- * @Mark Martinez
- */
- navToMedicalDevice: function() {
- this.getRouter().navTo("MedicalDevice");
- },
- //Start - DHC-2005 - Code Insert - Maria Elise Martin - 01-10-2017
- /**
- * Navigation function used to navigate to ViewPastVisits page
- *
- * @author Elise Martin
- */
- navToViewPastVisits: function(){
- this.getRouter().navTo("ViewPastVisits");
- },
- //End - DHC-2005 - Code Insert - Maria Elise Martin - 01-10-2017
- /**
- * Navigation function used to navigate to Count Products page
- *
- * @author Karlo Marco D. Enero - Jan 11, 2017
- *
- * START OF CODING
- */
- navToCountProducts: function() {
- this.getRouter().navTo("CountProducts");
- },
- /**
- * Function that returns the router for the current page
- *
- * @author
- */
- getRouter: function() {
- return sap.ui.core.UIComponent.getRouterFor(this);
- },
- /**
- * Checks if the current device is an iOS device
- *
- * @author
- */
- isiOS: function() {
- return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
- },
- /**
- * Checks if the current device is an Android device
- *
- * @author
- */
- isAndroid: function() {
- return /android/.test(navigator.userAgent) && !window.MSStream;
- },
- /**
- * Function that generates a messagetoast for the received string text
- *
- * @author
- */
- toaster: function(sText) {
- sap.m.MessageToast.show(sText, {
- duration: 1000,
- width: "20em",
- my: "center bottom",
- at: "center bottom",
- of: window,
- offset: "0 0",
- collision: "fit fit",
- onClose: null,
- autoClose: true,
- animationTimingFunction: "ease",
- animationDuration: 2000,
- closeOnBrowserNavigation: true
- });
- },
- /**
- * Function that load contacts data to core,
- * used in EditPatientContact View and CareLocationSituation View
- *
- * @author
- */
- loadNewPatientData: function() {
- if (sap.ui.getCore().getModel() === undefined ){//|| (sap.ui.getCore().getModel() !== undefined && sap.ui.getCore().getModel().getProperty("/patient")) ) {
- var data = {
- "patient": {
- "patientCheckStatus": 0,
- "checkSubmit": false,
- "changeRequest":{
- "changeDate":{
- "value": undefined,
- "mandatory": true,
- "updated": false
- },
- "changeReason":{
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "inPatientMasterData": {
- "value": false,
- "mandatory": true,
- "updated": false
- },
- "rejectReason":{
- "value": "",
- "mandatory": true,
- "updated": false
- }
- },
- "info": {
- "id": {
- "value": "DHC_0001",
- "mandatory": false,
- "updated": false
- },
- "gender": {
- "value": 1,
- "mandatory": true,
- "updated": false
- },
- "firstName": {
- "value": "Hans",
- "mandatory": true,
- "updated": false
- },
- "lastName": {
- "value": "Mustermann",
- "mandatory": true,
- "updated": false
- },
- "dateOfBirth": {
- "value": new Date(456966000000),
- "mandatory": true,
- "updated": false
- },
- "datePatientRequest": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "access": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "030 111222333",
- "mandatory": false,
- "updated": false
- },
- "tels": [{
- "value": "030 111222444",
- "mandatory": false,
- "updated": false
- }, {
- "value": "030 111222555",
- "mandatory": false,
- "updated": false
- }],
- "fax": {
- "value": "030 111222",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "max@muller.de",
- "mandatory": false,
- "updated": false
- },
- "circumstancesaAtDischarge": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "healthCheckDate": {
- "value": undefined,
- "mandatory": false,
- "updated": false
- },
- "therapeuticAreaPE": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "therapeuticAreaEE": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "therapeuticAreaWV": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "therapeuticAreaTS": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "height": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "weight": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "previousWeight": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "bmi": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "patientSick": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "foodReduced": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "lostWeight": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "whereIsPatient": {
- "value": -1,
- "mandatory": true,
- "updated": false
- }, //0=Home, 1=Institution, 2=Other
- "acceptment": {
- "value": -1,
- "mandatory": true,
- "updated": false
- },
- "freeTextJustification": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "accepted": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "notCheckedSimilar": {
- "value": true,
- "mandatory": false,
- "updated": false
- },"mpiId": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "patientStatus": {
- "value": 0,
- "mandatory": true,
- "updated": false
- }
- },
- "firstVisit": {
- "locationType": {
- "value": -1,
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "access": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "dateBegin": {
- "value": undefined,
- "mandatory": true,
- "updated": false
- }, //"Tue Nov 25 2016 23:00:00 GMT+0000 (GMT Standard Time)",
- "dateEnd": {
- "value": undefined,
- "mandatory": true,
- "updated": false
- }, //"Tue Nov 24 2016 23:59:00 GMT+0000 (GMT Standard Time)",
- "initialDoctorSelected": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "participants": [
- /*{
- "firstName" : "Max",
- "lastName": "Mullër",
- "info" : "",
- "isSelected" : true
- },
- {
- "firstName" : "Ich",
- "lastName": "",
- "info" : "",
- "isSelected" : true
- }*/
- ]
- },
- "reportingInstitution": {
- "institution": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "organization": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- }
- },
- "deliveryAddress": {
- "streetNew": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreetNew": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCodeNew": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "cityNew": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "addressOptions": {
- "value": -1,
- "mandatory": true,
- "updated": false
- },
- "receiver": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "desiredVisitTimeFrom": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "desiredVisitTimeTo": {
- "value": "",
- "mandatory": false,
- "updated": false
- }
- },
- "prescribingPhysician": {
- "previousDoctorFlag": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "previvousPhysician": {
- "previousPhysicianType": {
- "value": -1,
- "mandatory": true,
- "updated": false
- }, // 0 = Doctor, 1 = Institution
- "previousInstitution": {
- "type": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "name": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "details": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "doctorGenre": {
- "value": -1,
- "mandatory": false,
- "updated": false
- },
- "doctorFirstName": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "doctorLastName": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "dischargeDate": {
- "value": undefined,
- "mandatory": false,
- "updated": false
- },
- "newFax": {
- "value": -1,
- "mandatory": false,
- "updated": false
- },
- "otherFax": {
- "value": "",
- "mandatory": false,
- "updated": false
- }
- },
- "previousDoctor": {
- "name": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "speciality": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "timeSchedule": {
- "value": {
- 1: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 2: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 3: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 4: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 5: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- }
- },
- "mandatory": false,
- "updated": false
- }
- }
- },
- "prescribingDoctor": [{
- "name": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "speciality": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "timeSchedule": {
- "value": {
- 1: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 2: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 3: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 4: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 5: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- }
- },
- "mandatory": false,
- "updated": false
- },
- "therapeuticAreaEE": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "therapeuticAreaPE": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "therapeuticAreaWV": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "therapeuticAreaTS": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "otherTherapeuticArea": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "holidays": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "holidaysFrom": {
- "value": undefined,
- "mandatory": false,
- "updated": false
- },
- "holidaysTo": {
- "value": undefined,
- "mandatory": false,
- "updated": false
- },
- "temporaryDoctor": {
- "name": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "speciality": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "timeSchedule": {
- "value": {
- 1: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 2: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 3: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 4: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 5: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- }
- },
- "mandatory": false,
- "updated": false
- }
- }
- }]
- },
- "dischargeInstitution": {
- "type": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "name": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "details": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "doctorGenre": {
- "value": -1,
- "mandatory": false,
- "updated": false
- },
- "doctorFirstName": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "doctorLastName": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "dischargeDate": {
- "value": undefined,
- "mandatory": false,
- "updated": false
- },
- "newFax": {
- "value": -1,
- "mandatory": false,
- "updated": false
- },
- "otherFax": {
- "value": "",
- "mandatory": false,
- "updated": false
- }
- },
- "careSituation": {
- "careSituationType": {
- "value": 0,
- "mandatory": true,
- "updated": false
- }, // 0 = "Eigene Hauslichkeit", 1 = Ambulante Pflege , 2 = Plegeheim
- "name": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "access": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "farFromStreet": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "withoutElevator": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "notForWheelchair": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "parkingMorning": {
- "value": 0,
- "mandatory": false,
- "updated": false
- },
- "parkingNoon": {
- "value": 0,
- "mandatory": false,
- "updated": false
- },
- "parkingEvening": {
- "value": 0,
- "mandatory": false,
- "updated": false
- },
- "desiredVisitTimeFrom": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "desiredVisitTimeTo": {
- "value": "",
- "mandatory": false,
- "updated": false
- }
- },
- "livingConditionsInfo": {
- "data": {
- "value": -1,
- "mandatory": true,
- "updated": false
- }, //REQ
- "spaceCare": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "spaceRefrigerator": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "spaceGadgets": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "spaceProductBoxes": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "thereIsWater": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "thereIsElectricity": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "thereIsPets": {
- "value": false,
- "mandatory": false,
- "updated": false
- }
- },
- "patientContacts": [
- /*{
- "gender": 0,
- "firstName": "Leilar",
- "lastName": "Muller",
- "street": "Straußmannstr. 168",
- "additionalStreet": "",
- "zipCode": "12047",
- "city": "Berlin-Neukölln",
- "tel": "0221 668 668 25",
- "tels": [],
- "fax": "0221 668 668 44",
- "email": "leilar@muller.de",
- "institutionName": "",
- "type": 0,
- "livesWith": false,
- "isLegalGuardian": false,
- "isPersonContact": false,
- "firstVisit": false
- },
- {
- "gender": 1,
- "firstName": "Struck",
- "lastName": "Blau",
- "street": "Blaumannstr. n.º168",
- "additionalStreet": "",
- "zipCode": "12047",
- "city": "Berlin-Neukölln",
- "tel": "030 65656500",
- "tels": [
- {"tel": "0221 668 333 34"}
- ],
- "fax": "030 65656501",
- "email": "struck@blau.de",
- "institutionName": "",
- "type": 1,
- "livesWith": true,
- "isLegalGuardian": true,
- "isPersonContact": false,
- "firstVisit": false
- },
- {
- "gender": 0,
- "firstName": "Manuella",
- "lastName": "Sommer",
- "street": "Straußmannstr. 168",
- "additionalStreet": "",
- "zipCode": "12047",
- "city": "Berlin-Neukölln",
- "tel": "0221 668 778 25",
- "tels": [
- {"tel": "0221 668 333 34"}
- ],
- "fax": "0221 668 778 44",
- "email": "manuella@sommer.de",
- "institutionName": "",
- "type": 1,
- "livesWith": true,
- "isLegalGuardian": false,
- "isPersonContact": true,
- "firstVisit": false
- },
- {
- "gender": 0,
- "firstName": "Manuella",
- "lastName": "Sommer",
- "street": "Straußmannstr. 168",
- "additionalStreet": "",
- "zipCode": "12047",
- "city": "Berlin-Neukölln",
- "tel": "0221 668 668 25",
- "tels": [
- {"tel": "0221 668 333 34"}
- ],
- "fax": "0221 668 668 44",
- "email": "kontakt@hkk.de",
- "institutionName": "HKK",
- "type": 3,
- "livesWith": false,
- "isLegalGuardian": false,
- "isPersonContact": false,
- "firstVisit": false
- }*/
- ],
- "pharmacy": {
- "name": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "additionalStreet": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "timeSchedule": {
- "value": {
- 1: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 2: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 3: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 4: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- },
- 5: {
- morningOpen: "",
- morningClose: "",
- afternoonOpen: "",
- afternoonClose: ""
- }
- },
- "mandatory": false,
- "updated": false
- }
- },
- "insurance": {
- "institutionName": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "street": {
- "value": "",
- "mandatory": true,
- "updated": false
- },
- "zipCode": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "city": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "tel": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "fax": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "email": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "memberShipNumber": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "type": {
- "value": -1,
- "mandatory": true,
- "updated": false
- },
- "paymentStatus": {
- "value": false,
- "mandatory": true,
- "updated": false
- },
- "uploadedPayment": {
- "value": false,
- "mandatory": true,
- "updated": false
- },
- "uploadedDatePayment": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "payers": {
- "value": false,
- "mandatory": true,
- "updated": false
- },
- "uploadedPayers": {
- "value": false,
- "mandatory": true,
- "updated": false
- },
- "uploadedDatePayers": {
- "value": "",
- "mandatory": false,
- "updated": false
- },
- "careLevel": {
- "value": false,
- "mandatory": false,
- "updated": false
- }
- },
- "consent": {
- "care": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "data": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "photographic": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "telephone": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "revoke": {
- "value": false,
- "mandatory": false,
- "updated": false
- },
- "date": {
- "value": undefined,
- "mandatory": false,
- "updated": false
- }
- }
- }
- };
- var oModel = new sap.ui.model.json.JSONModel();
- oModel.setData(data);
- sap.ui.getCore().setModel(oModel);
- }
- },
- /**
- * Function that adds existing patient data to PatientModel,
- *
- * @author
- */
- addExistingPatientData: function() {
- var oData = {
- "patients": [{
- "id": "1",
- "Name": "Maike",
- "Last_Name": "Stephen",
- "Birth_Date": "03.11.1931",
- "Last_Update": new Date("01/12/2016"),
- "Gender": "M",
- "Building": "Gebaude 2, Zimmer 255",
- "Street": "Sunshinestrasse 125, 12855 Berlin",
- "Delivery_Time": "Wunschlieferzeit 08:00AM-08:00PM",
- "Image": "resources/common/assets/profile-circle.svg",
- "DoctorName_TS": "Ann Stein",
- "DoctorGender_TS": "M",
- "DoctorName_EE": "Max Muller",
- "DoctorGender_EE": "M",
- "DoctorName_PE": "Carl Stein",
- "DoctorGender_PE": "M",
- "DoctorName_WV": "Rachel Muller",
- "DoctorGender_WV": "F",
- "Last_Prescription": "No",
- "therapeuticAreaTS": true,
- "therapeuticAreaEE": true,
- "therapeuticAreaPE": false,
- "therapeuticAreaWV": true,
- "Therapy_Plan": {
- "TS": true,
- "EE": true,
- "PE": false,
- "WV": true,
- "Non_Prescription": [{
- "id": "00000",
- "Name": "Fresubin 2 kcal Fibre Drink",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00003",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "10.12.2016"
- }, {
- "id": "00004",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "11.12.2016"
- }]
- }, {
- "id": "00001",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "26.12.2016",
- "Alternatives": [{
- "id": "00005",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack ALTERNATIVE 1",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "24.12.2016"
- }]
- }, {
- "id": "00002",
- "Name": "Mudan Fresan",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "23.12.2016",
- "Alternatives": [{
- "id": "00007",
- "Name": "Mudan Fresan ALTERNATIVE 1",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "22.12.2016"
- }]
- }],
- "Prescription_EE": [],
- "Prescription_PE": [],
- "Prescription_TS": [{
- "id": "00000",
- "Name": "Fresubin 2 kcal Fibre Drink",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00003",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "30.12.2016"
- }, {
- "id": "00004",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "29.12.2016"
- }]
- }, {
- "id": "00001",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "28.12.2016",
- "Alternatives": [{
- "id": "00005",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "27.12.2016"
- }, {
- "id": "0006",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "26.12.2016"
- }]
- }, {
- "id": "00002",
- "Name": "Mudan Fresan",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00007",
- "Name": "Mudan Fresan ALTERNATIVE 1",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "25.12.2016"
- }]
- }],
- "Prescription_WV": [{
- "id": "00000",
- "Name": "Fresubin 2 kcal Fibre Drink",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "24.12.2016",
- "Alternatives": [{
- "id": "00003",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "23.12.2016"
- }, {
- "id": "00004",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "23.12.2016"
- }]
- }, {
- "id": "00001",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00005",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "24.12.2016"
- }, {
- "id": "0006",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "23.12.2016"
- }]
- }, {
- "id": "00002",
- "Name": "Mudan Fresan",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "20.12.2016",
- "Alternatives": [{
- "id": "00007",
- "Name": "Mudan Fresan ALTERNATIVE 1",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "25.12.2016"
- }]
- }]
- }
- }, {
- "id": "2",
- "Name": "Sandra",
- "Last_Name": "Sielmann",
- "Birth_Date": "15.08.1931",
- "Last_Update": new Date("01/12/2016"),
- "Gender": "F",
- "Building": "Gebaude 2, Zimmer 255",
- "Street": "Sunshinestrasse 125, 12855 Berlin",
- "Delivery_Time": "Wunschlieferzeit 08:00AM-08:00PM",
- "Image": "resources/common/assets/profile-circle.svg",
- "DoctorName_TS": "Ann Stein",
- "DoctorGender_TS": "M",
- "DoctorName_EE": "Max Muller",
- "DoctorGender_EE": "M",
- "DoctorName_PE": "Carl Stein",
- "DoctorGender_PE": "M",
- "DoctorName_WV": "Rachel Muller",
- "DoctorGender_WV": "F",
- "therapeuticAreaTS": false,
- "therapeuticAreaEE": false,
- "therapeuticAreaPE": true,
- "therapeuticAreaWV": false,
- "Last_Prescription": {
- "TS": false,
- "EE": false,
- "PE": true,
- "WV": false,
- "Non_Prescription": [],
- "Prescription_PE": [{
- "id": "00000",
- "Name": "Fresubin 2 kcal Fibre Drink",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 0,
- "Delivery_Date": "25.11.2016",
- "Alternatives": [{
- "id": "00003",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "10.12.2016"
- }, {
- "id": "00004",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "01.12.2016"
- }]
- }, {
- "id": "00001",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "10.10.2016",
- "Alternatives": [{
- "id": "00005",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "11.12.2016"
- }, {
- "id": "0006",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "10.12.2016"
- }]
- }, {
- "id": "00002",
- "Name": "Mudan Fresan",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "09.12.2016",
- "Alternatives": [{
- "id": "00007",
- "Name": "Mudan Fresan ALTERNATIVE 1",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "08.12.2016"
- }]
- }],
- "Prescription_EE": [],
- "Prescription_TS": [],
- "Prescription_WV": []
- },
- "Therapy_Plan": {
- "TS": true,
- "EE": true,
- "PE": false,
- "WV": true,
- "Non_Prescription": [{
- "id": "00000",
- "Name": "Fresubin 2 kcal Fibre Drink",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00003",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "10.12.2016"
- }, {
- "id": "00004",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "11.12.2016"
- }]
- }, {
- "id": "00001",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "26.12.2016",
- "Alternatives": [{
- "id": "00005",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack ALTERNATIVE 1",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "24.12.2016"
- }]
- }, {
- "id": "00002",
- "Name": "Mudan Fresan",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "23.12.2016",
- "Alternatives": [{
- "id": "00007",
- "Name": "Mudan Fresan ALTERNATIVE 1",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Selbstzahler",
- "Therapeutic_Plan": "EE",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "22.12.2016"
- }]
- }],
- "Prescription_EE": [],
- "Prescription_PE": [],
- "Prescription_TS": [{
- "id": "00000",
- "Name": "Fresubin 2 kcal Fibre Drink",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00003",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "30.12.2016"
- }, {
- "id": "00004",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "29.12.2016"
- }]
- }, {
- "id": "00001",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "28.12.2016",
- "Alternatives": [{
- "id": "00005",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "27.12.2016"
- }, {
- "id": "0006",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "26.12.2016"
- }]
- }, {
- "id": "00002",
- "Name": "Mudan Fresan",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00007",
- "Name": "Mudan Fresan ALTERNATIVE 1",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "TS",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "25.12.2016"
- }]
- }],
- "Prescription_WV": [{
- "id": "00000",
- "Name": "Fresubin 2 kcal Fibre Drink",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "24.12.2016",
- "Alternatives": [{
- "id": "00003",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "23.12.2016"
- }, {
- "id": "00004",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "23.12.2016"
- }]
- }, {
- "id": "00001",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00005",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "24.12.2016"
- }, {
- "id": "0006",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "23.12.2016"
- }]
- }, {
- "id": "00002",
- "Name": "Mudan Fresan",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "20.12.2016",
- "Alternatives": [{
- "id": "00007",
- "Name": "Mudan Fresan ALTERNATIVE 1",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "WV",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "25.12.2016"
- }]
- }]
- }
- }, {
- "id": "3",
- "Name": "Ana",
- "Last_Name": "João",
- "Birth_Date": "15.02.1991",
- "Last_Update": new Date("01/12/2016"),
- "Gender": "F",
- "Building": "Gebaude 2, Zimmer 255",
- "Street": "Sunshinestrasse 125, 12855 Berlin",
- "Delivery_Time": "Wunschlieferzeit 08:00AM-08:00PM",
- "Image": "resources/common/assets/profile-circle.svg",
- "DoctorName_TS": "Ann Stein",
- "DoctorGender_TS": "M",
- "DoctorName_EE": "Max Muller",
- "DoctorGender_EE": "M",
- "DoctorName_PE": "Carl Stein",
- "DoctorGender_PE": "M",
- "DoctorName_WV": "Rachel Muller",
- "DoctorGender_WV": "F",
- "Last_Prescription": "No",
- "therapeuticAreaTS": false,
- "therapeuticAreaEE": false,
- "therapeuticAreaPE": true,
- "therapeuticAreaWV": false,
- "Therapy_Plan": {
- "TS": false,
- "EE": false,
- "PE": true,
- "WV": false,
- "Non_Prescription": [],
- "Prescription_PE": [{
- "id": "00000",
- "Name": "Fresubin 2 kcal Fibre Drink",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "25.12.2016",
- "Alternatives": [{
- "id": "00003",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "10.12.2016"
- }, {
- "id": "00004",
- "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
- "Description": "Lemon 4x200 ml EasyDrink",
- "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "20.12.2016"
- }]
- }, {
- "id": "00001",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 4,
- "Stock": 15,
- "Delivery_Date": "10.12.2016",
- "Alternatives": [{
- "id": "00005",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "11.12.2016"
- }, {
- "id": "0006",
- "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
- "Description": "12x28 ml pack",
- "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 3,
- "Stock": 10,
- "Delivery_Date": "10.12.2016"
- }]
- }, {
- "id": "00002",
- "Name": "Mudan Fresan",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 4,
- "Stock": 3,
- "Delivery_Date": "09.12.2016",
- "Alternatives": [{
- "id": "00007",
- "Name": "Mudan Fresan ALTERNATIVE 1",
- "Description": "Neutral 1x450g Dose",
- "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
- "Payer_Condition": "Krankenkasse",
- "Therapeutic_Plan": "PE",
- "Quantity": 4,
- "Stock": 20,
- "Delivery_Date": "08.12.2016"
- }]
- }],
- "Prescription_EE": [],
- "Prescription_TS": [],
- "Prescription_WV": []
- }
- }, {
- "id": "4",
- "Name": "Max",
- "Last_Name": "Müller",
- "Birth_Date": "",
- "Last_Update": new Date("01/12/2016"),
- "Gender": "M",
- "Building": "",
- "Street": "",
- "Delivery_Time": "Wunschlieferzeit 08:00AM-08:00PM",
- "Image": "resources/common/assets/profile-circle.svg",
- "DoctorName_TS": "Ann Stein",
- "DoctorGender_TS": "M",
- "DoctorName_EE": "Max Muller",
- "DoctorGender_EE": "M",
- "DoctorName_PE": "Carl Stein",
- "DoctorGender_PE": "M",
- "DoctorName_WV": "Rachel Muller",
- "DoctorGender_WV": "F",
- "Last_Prescription": "No",
- "therapeuticAreaTS": false,
- "therapeuticAreaEE": false,
- "therapeuticAreaPE": false,
- "therapeuticAreaWV": false,
- "Therapy_Plan": "No"
- }]
- };
- var oModel = new sap.ui.model.json.JSONModel(oData);
- sap.ui.getCore().setModel(oModel, "PATIENTMODEL");
- },
- /**
- * Function that receives integers year, month and day and converts them
- * and returns concatenated string date with values year , month and day
- *
- * @author
- */
- dateAsString: function(iYear, iMonth, iDay) {
- var sDateString;
- if (iDay < 10 && iMonth >= 10) {
- sDateString = iYear.toString() + iMonth.toString() + "0" + iDay.toString();
- } else if (iMonth < 10 && iDay >= 10) {
- sDateString = iYear.toString() + "0" + iMonth.toString() + iDay.toString();
- } else if (iMonth < 10 && iDay < 10) {
- sDateString = iYear.toString() + "0" + iMonth.toString() + "0" + iDay.toString();
- } else {
- sDateString = iYear.toString() + iMonth.toString() + iDay.toString();
- }
- return sDateString;
- },
- /**
- * Function that receives string param and
- * returns the age corresponding
- *
- * @author
- */
- getAge: function(sParam) {
- var oTodayDate = new Date();
- var iTodayMonth = oTodayDate.getMonth();
- var iTodayYear = oTodayDate.getFullYear();
- var iTodayDay = oTodayDate.getDate();
- var sStringbirthYear = sParam.substring(6, 10);
- var iBirthYear = parseInt(sStringbirthYear, 10);
- var sStringbirthMonth = sParam.substring(3, 5);
- var iBirthMonth = parseInt(sStringbirthMonth, 10);
- var sStringbirthDay = sParam.substring(0, 2);
- var iBirthYear = parseInt(sStringbirthDay, 10);
- var iAgePatient = iTodayYear - iBirthYear;
- if (iTodayMonth < (iBirthYear - 1)) {
- iAgePatient--;
- }
- if (((iBirthYear - 1) === iTodayMonth) && (iTodayDay < iBirthDay)) {
- iAgePatient--;
- }
- return iAgePatient;
- },
- /**
- * Function that load model of property AcceptedPatients case exists,
- * else it just initiate with empty data
- *
- * @author
- */
- loadAcceptedPatients: function() {
- var oModel = sap.ui.getCore().getModel();
- var oData = [];
- if (!oModel.getProperty("/acceptedPatients")) {
- oModel.setProperty("/acceptedPatients", oData);
- }
- },
- /**
- * Function that receives string street, city, telephone, fax and email and
- * returns true if none is empty, or false if at least one is empty
- *
- * @author
- */
- getVisibilityGeneralData: function(sStreet, sCity, sTel, sFax, sEmail) {
- if (!sStreet || !sCity || !sTel || !sFax || !sEmail) {
- return false;
- } else if (sStreet.length > 0 || sCity.length > 0 || sTel.length > 0 || sFax.length > 0 || sEmail.length > 0) {
- return true;
- } else {
- return false;
- }
- },
- /**
- * Function that receives string street, city, telephone, fax and email and
- * returns true if all are empty, or false if at least one is not empty
- *
- * @author
- */
- getVisibilityUnknownGeneral: function(sStreet, sCity, sTel, sFax, sEmail) {
- if (!sStreet || !sCity || !sTel || !sFax || !sEmail) {
- return true;
- } else if (sStreet.length > 0 || sCity.length > 0 || sTel.length > 0 || sFax.length > 0 || sEmail.length > 0) {
- return false;
- } else {
- return true;
- }
- },
- /**
- * Function that receives object input, city, and returns
- * X in case variable is true, "" in case variable is false,
- * true in case variable is X and false in case variable is ""
- *
- * @author
- */
- XToTrueAndTrueToX: function(oInput) {
- switch (oInput) {
- case true:
- return "X";
- case false:
- return "";
- case "X":
- return true;
- case "":
- return false;
- default:
- break;
- }
- },
- /**
- * Function that receives integer input and
- * return true in case variable is equal to 0 or 1, and false otherwise
- *
- * @author
- */
- getSelectedCheckBox: function(iInput) {
- if (iInput === 0 || iInput === 1) {
- return true;
- } else {
- return false;
- }
- },
- /**
- * Function that load model of property Institutions
- * according to the data build in the function
- *
- * @author
- */
- loadInstitutionsData: function() {
- var aInstData = [{
- name: "Bunter Strauß",
- street: "Straußmannstr.",
- additionalStreet: "168",
- zipCode: "12047",
- city: "Berlin-Neukolln",
- tel: "030 85858585",
- fax: "030 85858585",
- email: "kontakt@bunterstrausspflegeheim.de"
- }, {
- name: "Institution2",
- street: "Street2",
- additionalStreet: "002",
- zipCode: "00002",
- city: "City2",
- tel: "030 00000003",
- fax: "030 00000004",
- email: "email2@gmx.de"
- }];
- var oModel = this.getView().getModel();
- oModel.setProperty("/institutions", aInstData);
- },
- /**
- * Function that receives a string key and load model of property Institutions
- * according to the data build in the different varible key cases
- *
- * @author
- */
- loadnameDischargingInsitution: function(sKey) {
- var aDischargeInstitutionData;
- switch (sKey) {
- case "Krankenhaus":
- aDischargeInstitutionData = [{
- "name": "KH Vivantes Berlin-Neuköllnd",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "12047",
- "city": "Berlin-Neukölln",
- "tel": "030 85858585",
- "fax": "030 85858588",
- "email": "kontakt@vivantes.de"
- }, {
- "name": "Kwqeqwellnd",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }];
- break;
- case "Händler":
- aDischargeInstitutionData = [{
- "name": "OLa",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }, {
- "name": "Mundo",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }];
- break;
- case "Kostenträger":
- aDischargeInstitutionData = [{
- "name": "Kostenträger",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }, {
- "name": "Kostenträger",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }];
- break;
- case "Praxis":
- aDischargeInstitutionData = [{
- "name": "Praxis",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }, {
- "name": "Praxis2",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }];
- break;
- case "Pflegedienst":
- aDischargeInstitutionData = [{
- "name": "Pflegedienst",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }];
- break;
- case "Pflegeeinrichtung":
- aDischargeInstitutionData = [{
- "name": "Pflegeeinrichtung",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }];
- break;
- case "Apotheke":
- aDischargeInstitutionData = [{
- "name": "Apotheke",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }];
- break;
- case "Netzwerkpartner":
- aDischargeInstitutionData = [{
- "name": "Netzwerkpartner",
- "street": "Straußmannstr. 168",
- "additionalStreet": "LOL",
- "zipCode": "1eqwe7",
- "city": "qweln",
- "tel": "029328585",
- "fax": "12312123128",
- "email": "kontakt@vivantes.de"
- }];
- break;
- }
- var oModel = this.getView().getModel();
- oModel.setProperty("/institutions", aDischargeInstitutionData);
- oModel.refresh();
- },
- /**
- * In this function, we will validate the string fields.
- *
- * @author Francisco Onieva
- */
- validateStringField: function(str) {
- var rValidRegEx = /^[^\\\/&]+$/;
- return rValidRegEx.test(str);
- },
- /**
- * In this function, we will validate the datetime fields.
- *
- * @author Francisco Onieva
- */
- validateDateField: function(date) {
- /*var rValidRegEx = /^\d{1,2}\.\d{1,2}\.\d{4}$/;
- return rValidRegEx.test(date);*/
- if(date){
- if (date.getDate && date.getMonth && date.getYear) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- },
- /**
- * In this function, we will validate the number fields.
- *
- * @author Francisco Onieva
- */
- validateNumberField: function(number) {
- var rValidRegEx = /^(\+)*[0-9 ]+$/;
- return rValidRegEx.test(number);
- },
- /**
- * In this function, we will validate the float fields.
- *
- * @author Tiago Martins
- */
- validateFloatField: function(number) {
- var rValidRegEx = /^[0-9]+(\.|,)?([0-9]+)?$/;
- return rValidRegEx.test(number);
- },
- /**
- * In this function, we will validate the email fields.
- *
- * @author José Graça
- */
- validateEmailField: function(email) {
- var validRegEx = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/;
- return validRegEx.test(email);
- },
- /**
- * In this function, we will validate the hours fields.
- *
- * @author José Graça
- */
- validateHoursField: function(hour) {
- var validRegEx = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/;
- return validRegEx.test(hour);
- },
- /**
- * Parse the Json date received and return the date
- *
- * @author Francisco Onieva
- */
- parseJsonDate: function(dJsonDate) {
- var dOffset = new Date().getTimezoneOffset();
- var aParts = /\/Date\((-?\d+)([+-]\d{2})?(\d{2})?.*/.exec(dJsonDate);
- if (aParts[2] == undefined) {
- aParts[2] = 0;
- }
- if (aParts[3] == undefined) {
- aParts[3] = 0;
- }
- return new Date(+aParts[1] + dOffset + aParts[2] * 3600000 + aParts[3] * 60000);
- },
- /**
- * This function puts the field update when the string field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForString: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("value");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- bEqualsTo = false;
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- var sValue = oEvent.getSource().getValue();
- if (this.validateStringField(sValue)) {
- this.getView().getModel().setProperty(sPathUpdated, true);
- } else {
- if (sValue === "") {
- this.getView().getModel().setProperty(sPathUpdated, true);
- } else {
- this.getView().getModel().setProperty(sPathUpdated, false);
- }
- }
- //Force refreshModel
- sPathValue = aPathContext.join("/") + "/value";
- this.getView().getModel().setProperty(sPathValue, sValue);
- //If the user is in the Patient Master Data, change text color to green
- if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
- this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
- oEvent.getSource().addStyleClass("fs_ws_positive_color");
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_positive_color");
- oEvent.getSource().addStyleClass("fs_ws_gray1_color");
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * This function puts the field update when the number field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForNumber: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("value");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- bEqualsTo = false;
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- var sValue = oEvent.getParameter("value");
- if (this.validateNumberField(sValue)) {
- this.getView().getModel().setProperty(sPathUpdated, true);
- } else {
- this.getView().getModel().setProperty(sPathUpdated, false);
- }
- //Force refreshModel
- sPathValue = aPathContext.join("/") + "/value";
- this.getView().getModel().setProperty(sPathValue, sValue);
- //If the user is in the Patient Master Data, change text color to green
- if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
- this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- if(oEvent.getId() === "change"){
- oEvent.getSource().removeStyleClass("fs_ws_freseniusblue_slider");
- oEvent.getSource().addStyleClass("fs_ws_positive_slider");
- }
- else{
- oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
- oEvent.getSource().addStyleClass("fs_ws_positive_color");
- }
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- if(oEvent.getId() === "change"){
- oEvent.getSource().removeStyleClass("fs_ws_positive_slider");
- oEvent.getSource().addStyleClass("fs_ws_freseniusblue_slider");
- }
- else{
- oEvent.getSource().removeStyleClass("fs_ws_positive_color");
- oEvent.getSource().addStyleClass("fs_ws_gray1_color");
- }
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * This function puts the field update when the float field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForFloat: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("value");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- bEqualsTo = false;
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- var sValue = oEvent.getParameter("value");
- if (this.validateFloatField(sValue)) {
- this.getView().getModel().setProperty(sPathUpdated, true);
- } else {
- this.getView().getModel().setProperty(sPathUpdated, false);
- }
- //Force refreshModel
- sPathValue = aPathContext.join("/") + "/value";
- this.getView().getModel().setProperty(sPathValue, sValue);
- //If the user is in the Patient Master Data, change text color to green
- if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
- this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
- oEvent.getSource().addStyleClass("fs_ws_positive_color");
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_positive_color");
- oEvent.getSource().addStyleClass("fs_ws_gray1_color");
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * This function puts the field update when the date field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForDate: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("dateValue");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- bEqualsTo = false;
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- var oValue = oEvent.getSource().getDateValue();
- if (this.validateDateField(oValue)) {
- this.getView().getModel().setProperty(sPathUpdated, true);
- } else {
- this.getView().getModel().setProperty(sPathUpdated, false);
- }
- //Force refreshModel
- sPathValue = aPathContext.join("/") + "/value";
- this.getView().getModel().setProperty(sPathValue, oValue);
- //If the user is in the Patient Master Data, change text color to green
- if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
- this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_gray3_color");
- oEvent.getSource().addStyleClass("fs_ws_positive_color");
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_positive_color");
- oEvent.getSource().addStyleClass("fs_ws_gray3_color");
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * This function puts the field update when the email field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForEmail: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("value");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- bEqualsTo = false;
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- var sValue = oEvent.getParameter("value");
- if (this.validateEmailField(sValue)) {
- this.getView().getModel().setProperty(sPathUpdated, true);
- } else {
- this.getView().getModel().setProperty(sPathUpdated, false);
- }
- //Force refreshModel
- sPathValue = aPathContext.join("/") + "/value";
- this.getView().getModel().setProperty(sPathValue, sValue);
- //If the user is in the Patient Master Data, change text color to green
- if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
- this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
- oEvent.getSource().addStyleClass("fs_ws_positive_color");
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_positive_color");
- oEvent.getSource().addStyleClass("fs_ws_gray1_color");
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * This function puts the field update when the boolean field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForBoolean: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("selected");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- this.getView().getModel().setProperty(sPathUpdated, true);
- sPathValue = aPathContext.join("/") + "/value";
- //If the user is in the Patient Master Data, change text color to green
- if(this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value")){
- var oText = oEvent.getSource();
- var oCheckBox = oEvent.getSource();
- if(oEvent.getSource().getText()===""){
- oText = oEvent.getSource().getParent().getItems()[1];
- }
- if(sap.ui.getCore().getModel().getProperty(sPathValue) !== undefined){
- if( this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- oText.removeStyleClass("fs_ws_gray1_color");
- oText.addStyleClass("fs_ws_positive_color");
- oCheckBox.addStyleClass("fs_ws_positive_checkbox");
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- oCheckBox.removeStyleClass("fs_ws_positive_checkbox");
- oText.removeStyleClass("fs_ws_positive_color");
- oText.addStyleClass("fs_ws_gray1_color");
- }
- }
- else{
- if( this.getView().getModel().getProperty(sPathUpdated) &&
- false !== this.getView().getModel().getProperty(sPathValue)){
- oText.removeStyleClass("fs_ws_gray1_color");
- oText.addStyleClass("fs_ws_positive_color");
- oCheckBox.addStyleClass("fs_ws_positive_checkbox");
- }
- else if(false === this.getView().getModel().getProperty(sPathValue)){
- oCheckBox.removeStyleClass("fs_ws_positive_checkbox");
- oText.removeStyleClass("fs_ws_positive_color");
- oText.addStyleClass("fs_ws_gray1_color");
- }
- }
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * This function puts the field update when the radio button field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForRadioButton: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("selectedIndex");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- bEqualsTo = false;
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- var sValue = oEvent.getParameter("selectedIndex");
- if (sValue > -1) {
- this.getView().getModel().setProperty(sPathUpdated, true);
- }
- sPathValue = aPathContext.join("/") + "/value";
- //If the user is in the Patient Master Data, change text color to green
- if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
- this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- var iValue = sap.ui.getCore().getModel().getProperty(sPathValue);
- for(var z=0; z< oEvent.getSource().getButtons().length ; z++){
- var oThisRadioButton = oEvent.getSource().getButtons()[z];
- oThisRadioButton.removeStyleClass("fs_ws_positive_radiobutton");
- oThisRadioButton.removeStyleClass("fs_ws_positive_color");
- oThisRadioButton.addStyleClass("fs_ws_gray1_color");
- }
- oEvent.getSource().getSelectedButton(iValue).removeStyleClass("fs_ws_gray1_color");
- oEvent.getSource().getSelectedButton(iValue).addStyleClass("fs_ws_positive_color");
- oEvent.getSource().getSelectedButton(iValue).addStyleClass("fs_ws_positive_radiobutton");
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- for(var z=0; z< oEvent.getSource().getButtons().length ; z++){
- var oThisRadioButton = oEvent.getSource().getButtons()[z];
- oThisRadioButton.removeStyleClass("fs_ws_positive_radiobutton");
- oThisRadioButton.removeStyleClass("fs_ws_positive_color");
- oThisRadioButton.addStyleClass("fs_ws_gray1_color");
- }
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * This function puts the field update when the select field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForSelect: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("selectedKey");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- bEqualsTo = false;
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- var sValue = oEvent.getSource().getSelectedKey();
- if (this.validateStringField(sValue)) {
- this.getView().getModel().setProperty(sPathUpdated, true);
- } else {
- this.getView().getModel().setProperty(sPathUpdated, false);
- }
- //Force refreshModel
- sPathValue = aPathContext.join("/") + "/value";
- this.getView().getModel().setProperty(sPathValue, sValue);
- sPathValue = aPathContext.join("/") + "/value";
- //If the user is in the Patient Master Data, change text color to green
- if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
- this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
- oEvent.getSource().addStyleClass("fs_ws_positive_color");
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_positive_color");
- oEvent.getSource().addStyleClass("fs_ws_gray1_color");
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * This function puts the field update when the hours field is filled
- *
- * @author José Graça
- */
- setFieldUpdatedFlagForHours: function(oEvent) {
- var oElement = oEvent.getSource();
- var sPathValue = oElement.getBindingPath("value");
- var aPathValue = sPathValue.split("/");
- aPathValue.pop();
- var aPathContext;
- if (oElement.getBindingContext()) {
- aPathContext = oElement.getBindingContext().getPath().split("/");
- } else {
- aPathContext = [];
- }
- var bEqualsTo = false;
- for (var i in aPathValue) {
- bEqualsTo = false;
- for (var j in aPathContext) {
- if (aPathContext[j] === aPathValue[i]) {
- bEqualsTo = true;
- break;
- }
- }
- if (bEqualsTo === false) {
- aPathContext.push(aPathValue[i]);
- }
- }
- var sPathUpdated = aPathContext.join("/") + "/updated";
- var oValue = oEvent.getSource().getValue();
- if (this.validateHoursField(oValue)) {
- this.getView().getModel().setProperty(sPathUpdated, true);
- } else {
- this.getView().getModel().setProperty(sPathUpdated, false);
- }
- //Force refreshModel
- sPathValue = aPathContext.join("/") + "/value";
- this.getView().getModel().setProperty(sPathValue, oValue);
- //If the user is in the Patient Master Data, change text color to green
- if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
- this.getView().getModel().getProperty(sPathUpdated) &&
- sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
- oEvent.getSource().addStyleClass("fs_ws_positive_color");
- }
- else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
- oEvent.getSource().removeStyleClass("fs_ws_positive_color");
- oEvent.getSource().addStyleClass("fs_ws_gray1_color");
- }
- //Change the checkSubmit field in order to trigger the getEnabledButton
- this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
- },
- /**
- * Get as parameter the index of the contact, and reset the view model fields of that contact.
- *
- * @author Tiago Martins
- */
- resetContact: function(iIndex) {
- var aContacts = this.getView().getModel().getProperty("/patient/patientContacts");
- aContacts[iIndex].gender.value = -1;
- aContacts[iIndex].gender.updated = false;
- aContacts[iIndex].firstName.value = "";
- aContacts[iIndex].firstName.updated = false;
- aContacts[iIndex].lastName.value = "";
- aContacts[iIndex].lastName.updated = false;
- aContacts[iIndex].street.value = "";
- aContacts[iIndex].street.updated = false;
- aContacts[iIndex].additionalStreet.value = "";
- aContacts[iIndex].additionalStreet.updated = false;
- aContacts[iIndex].zipCode.value = "";
- aContacts[iIndex].zipCode.updated = false;
- aContacts[iIndex].city.value = "";
- aContacts[iIndex].city.updated = false;
- aContacts[iIndex].tel.value = "";
- aContacts[iIndex].tel.updated = false;
- aContacts[iIndex].tels = [];
- aContacts[iIndex].fax.value = "";
- aContacts[iIndex].fax.updated = false;
- aContacts[iIndex].email.value = "";
- aContacts[iIndex].email.updated = false;
- aContacts[iIndex].institutionName.value = "";
- aContacts[iIndex].institutionName.updated = false;
- //Uncheck livesWith CheckBox
- /*if(aContacts[iIndex].livesWith){
- var oFragment = this.FragPatientContactOtherContact.getItems()[0].getItems()[2].getItems()[0].getItems()[iIndex].getContent()[0].getItems()[1];
- oFragment.getItems()[4].getItems()[0].getItems()[0].getItems()[0].setProperty("selected",false);
- }*/
- aContacts[iIndex].livesWith.value = false;
- aContacts[iIndex].livesWith.updated = false;
- aContacts[iIndex].isLegalGuardian.value = false;
- aContacts[iIndex].isLegalGuardian.updated = false;
- aContacts[iIndex].isPersonContact.value = false;
- aContacts[iIndex].isPersonContact.updated = false;
- aContacts[iIndex].firstVisit.value = false;
- aContacts[iIndex].firstVisit.updated = false;
- },
- //oModel = this.getView().getModel().getProperty("/patient")
- /**
- * This function puts all updates of the model with false
- *
- * @author Maria Araújo
- */
- cleanModelUpdate: function(oModel) {
- var i, j = 0;
- oModel = oModel.getProperty("/patient");
- oModel.checkSubmit = false;
- //info
- oModel.info.id.updated = false;
- oModel.info.gender.updated = false;
- oModel.info.firstName.updated = false;
- oModel.info.lastName.updated = false;
- oModel.info.dateOfBirth.updated = false;
- oModel.info.datePatientRequest.updated = false;
- oModel.info.street.updated = false;
- oModel.info.additionalStreet.updated = false;
- oModel.info.access.updated = false;
- oModel.info.zipCode.updated = false;
- oModel.info.city.updated = false;
- oModel.info.tel.updated = false;
- for (i = 0; i < oModel.info.tels.length; i++) {
- oModel.info.tels[i].updated = false;
- }
- oModel.info.fax.updated = false;
- oModel.info.email.updated = false;
- oModel.info.circumstancesaAtDischarge.updated = false;
- oModel.info.therapeuticAreaPE.updated = false;
- oModel.info.therapeuticAreaEE.updated = false;
- oModel.info.therapeuticAreaWV.updated = false;
- oModel.info.therapeuticAreaTS.updated = false;
- oModel.info.height.updated = false;
- oModel.info.weight.updated = false;
- oModel.info.previousWeight.updated = false;
- oModel.info.bmi.updated = false;
- oModel.info.patientSick.updated = false;
- oModel.info.foodReduced.updated = false;
- oModel.info.lostWeight.updated = false;
- oModel.info.whereIsPatient.updated = false;
- oModel.info.acceptment.updated = false;
- oModel.info.freeTextJustification.updated = false;
- oModel.info.accepted.updated = false;
- oModel.info.notCheckedSimilar.updated = false;
- //firstVisit
- oModel.firstVisit.locationType.updated = false;
- oModel.firstVisit.street.updated = false;
- oModel.firstVisit.additionalStreet.updated = false;
- oModel.firstVisit.zipCode.updated = false;
- oModel.firstVisit.city.updated = false;
- oModel.firstVisit.access.updated = false;
- oModel.firstVisit.dateBegin.updated = false;
- oModel.firstVisit.dateEnd.updated = false;
- oModel.firstVisit.initialDoctorSelected.updated = false;
- for (i = 0; i < oModel.firstVisit.participants.length; i++) {
- oModel.firstVisit.participants[i].firstName.updated = false;
- oModel.firstVisit.participants[i].lastName.updated = false;
- oModel.firstVisit.participants[i].role.updated = false;
- oModel.firstVisit.participants[i].isSelected.updated = false;
- }
- //reportingInstitution
- oModel.reportingInstitution.institution.updated = false;
- oModel.reportingInstitution.organization.updated = false;
- oModel.reportingInstitution.street.updated = false;
- oModel.reportingInstitution.additionalStreet.updated = false;
- oModel.reportingInstitution.tel.updated = false;
- oModel.reportingInstitution.fax.updated = false;
- oModel.reportingInstitution.email.updated = false;
- oModel.reportingInstitution.zipCode.updated = false;
- oModel.reportingInstitution.city.updated = false;
- //deliveryAddress
- oModel.deliveryAddress.streetNew.updated = false;
- oModel.deliveryAddress.additionalStreetNew.updated = false;
- oModel.deliveryAddress.zipCodeNew.updated = false;
- oModel.deliveryAddress.cityNew.updated = false;
- oModel.deliveryAddress.addressOptions.updated = false;
- oModel.deliveryAddress.receiver.updated = false;
- oModel.deliveryAddress.desiredVisitTimeFrom.updated = false;
- oModel.deliveryAddress.desiredVisitTimeTo.updated = false;
- //prescribingPhysician
- oModel.prescribingPhysician.previousDoctorFlag.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousPhysicianType.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.type.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.name.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.street.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.additionalStreet.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.zipCode.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.city.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.tel.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.fax.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.email.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.details.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.doctorGenre.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.doctorFirstName.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.doctorLastName.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.newFax.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousInstitution.otherFax.update = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.name.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.speciality.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.street.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.additionalStreet.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.zipCode.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.city.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.tel.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.fax.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.email.updated = false;
- oModel.prescribingPhysician.previvousPhysician.previousDoctor.timeSchedule.updated = false;
- for (i = 0; i < oModel.prescribingPhysician.prescribingDoctor.length; i++) {
- oModel.prescribingPhysician.prescribingDoctor[i].name.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].speciality.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].street.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].additionalStreet.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].zipCode.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].city.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].tel.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].fax.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].email.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].timeSchedule.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].therapeuticAreaEE.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].therapeuticAreaPE.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].therapeuticAreaTS.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].therapeuticAreaWV.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].otherTherapeuticArea.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].holidays.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].holidaysFrom.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].holidaysTo.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.name.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.speciality.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.street.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.additionalStreet.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.zipCode.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.city.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.tel.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.fax.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.email.updated = false;
- oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.timeSchedule.updated = false;
- }
- //dischargeInstitution
- oModel.dischargeInstitution.type.updated = false;
- oModel.dischargeInstitution.name.updated = false;
- oModel.dischargeInstitution.street.updated = false;
- oModel.dischargeInstitution.additionalStreet.updated = false;
- oModel.dischargeInstitution.zipCode.updated = false;
- oModel.dischargeInstitution.city.updated = false;
- oModel.dischargeInstitution.tel.updated = false;
- oModel.dischargeInstitution.fax.updated = false;
- oModel.dischargeInstitution.email.updated = false;
- oModel.dischargeInstitution.details.updated = false;
- oModel.dischargeInstitution.doctorGenre.updated = false;
- oModel.dischargeInstitution.doctorFirstName.updated = false;
- oModel.dischargeInstitution.doctorLastName.updated = false;
- oModel.dischargeInstitution.dischargeDate.updated = false;
- oModel.dischargeInstitution.newFax.updated = false;
- oModel.dischargeInstitution.otherFax.updated = false;
- //careSituation
- oModel.careSituation.careSituationType.updated = false;
- oModel.careSituation.name.updated = false;
- oModel.careSituation.street.updated = false;
- oModel.careSituation.additionalStreet.updated = false;
- oModel.careSituation.zipCode.updated = false;
- oModel.careSituation.city.updated = false;
- oModel.careSituation.tel.updated = false;
- oModel.careSituation.fax.updated = false;
- oModel.careSituation.email.updated = false;
- oModel.careSituation.access.updated = false;
- oModel.careSituation.farFromStreet.updated = false;
- oModel.careSituation.withoutElevator.updated = false;
- oModel.careSituation.notForWheelchair.updated = false;
- oModel.careSituation.parkingMorning.updated = false;
- oModel.careSituation.parkingNoon.updated = false;
- oModel.careSituation.parkingEvening.updated = false;
- oModel.careSituation.desiredVisitTimeFrom.updated = false;
- oModel.careSituation.desiredVisitTimeTo.updated = false;
- //livingConditionsInfo
- oModel.livingConditionsInfo.data.updated = false;
- oModel.livingConditionsInfo.spaceCare.updated = false;
- oModel.livingConditionsInfo.spaceRefrigerator.updated = false;
- oModel.livingConditionsInfo.spaceGadgets.updated = false;
- oModel.livingConditionsInfo.spaceProductBoxes.updated = false;
- oModel.livingConditionsInfo.thereIsWater.updated = false;
- oModel.livingConditionsInfo.thereIsElectricity.updated = false;
- oModel.livingConditionsInfo.thereIsPets.updated = false;
- //patientContatcs
- for (i = 0; i < oModel.patientContacts.length; i++) {
- oModel.patientContacts[i].gender.updated = false;
- oModel.patientContacts[i].firstName.updated = false;
- oModel.patientContacts[i].lastName.updated = false;
- oModel.patientContacts[i].street.updated = false;
- oModel.patientContacts[i].additionalStreet.updated = false;
- oModel.patientContacts[i].zipCode.updated = false;
- oModel.patientContacts[i].city.updated = false;
- oModel.patientContacts[i].tel.updated = false;
- for (j = 0; j < oModel.patientContacts[i].tels.length; j++) {
- oModel.patientContacts[i].tels[j].updated = false;
- }
- oModel.patientContacts[i].fax.updated = false;
- oModel.patientContacts[i].email.updated = false;
- oModel.patientContacts[i].institutionName.updated = false;
- oModel.patientContacts[i].type.updated = false;
- oModel.patientContacts[i].livesWith.updated = false;
- oModel.patientContacts[i].isLegalGuardian.updated = false;
- oModel.patientContacts[i].isPersonContact.updated = false;
- oModel.patientContacts[i].firstVisit.updated = false;
- }
- //pharmacy
- oModel.pharmacy.name.updated = false;
- oModel.pharmacy.street.updated = false;
- oModel.pharmacy.additionalStreet.updated = false;
- oModel.pharmacy.zipCode.updated = false;
- oModel.pharmacy.city.updated = false;
- oModel.pharmacy.tel.updated = false;
- oModel.pharmacy.fax.updated = false;
- oModel.pharmacy.email.updated = false;
- oModel.pharmacy.timeSchedule.updated = false;
- oModel.insurance.institutionName.updated = false;
- oModel.insurance.street.updated = false;
- oModel.insurance.zipCode.updated = false;
- oModel.insurance.city.updated = false;
- oModel.insurance.tel.updated = false;
- oModel.insurance.fax.updated = false;
- oModel.insurance.email.updated = false;
- oModel.insurance.memberShipNumber.updated = false;
- oModel.insurance.type.updated = false;
- oModel.insurance.paymentStatus.updated = false;
- oModel.insurance.uploadedPayment.updated = false;
- oModel.insurance.uploadedDatePayment.updated = false;
- oModel.insurance.payers.updated = false;
- oModel.insurance.uploadedPayers.updated = false;
- oModel.insurance.uploadedDatePayers.updated = false;
- oModel.insurance.careLevel.updated = false;
- oModel.consent.care.updated = false;
- oModel.consent.data.updated = false;
- oModel.consent.photographic.updated = false;
- oModel.consent.telephone.updated = false;
- oModel.consent.revoke.updated = false;
- oModel.consent.date.updated = false;
- //changeRequest
- if(oModel.changeRequest){
- oModel.changeRequest.changeDate.updated = false;
- oModel.changeRequest.changeReason.updated = false;
- oModel.changeRequest.rejectReason.updated = false;
- }
- },
- /**
- * This function transforms all the dates to an object
- *
- * @author José Graça
- */
- setDatesAsObject: function(oData) {
- if(oData.info){
- if(oData.info.dateOfBirth.value){
- oData.info.dateOfBirth.value = new Date(oData.info.dateOfBirth.value);
- }
- if(oData.info.healthCheckDate.value){
- oData.info.healthCheckDate.value = new Date(oData.info.healthCheckDate.value);
- } else{
- oData.info.healthCheckDate.value = undefined;
- }
- }
- if(oData.firstVisit){
- if(oData.firstVisit.dateBegin.value){
- oData.firstVisit.dateBegin.value = new Date(oData.firstVisit.dateBegin.value);
- } else{
- oData.firstVisit.dateBegin.value = undefined;
- }
- if(oData.firstVisit.dateEnd.value){
- oData.firstVisit.dateEnd.value = new Date(oData.firstVisit.dateEnd.value);
- } else{
- oData.firstVisit.dateEnd.value = undefined;
- }
- }
- if(oData.prescribingPhysician){
- if(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value){
- oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value = new Date(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value);
- } else{
- oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value = undefined;
- }
- for(var i in oData.prescribingPhysician.prescribingDoctor){
- if(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value){
- oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value = new Date(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value);
- } else{
- oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value = undefined;
- }
- if(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value){
- oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value = new Date(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value);
- } else{
- oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value = undefined;
- }
- }
- }
- if(oData.dischargeInstitution){
- if(oData.dischargeInstitution.dischargeDate.value){
- oData.dischargeInstitution.dischargeDate.value = new Date(oData.dischargeInstitution.dischargeDate.value);
- } else{
- oData.dischargeInstitution.dischargeDate.value = undefined;
- }
- }
- if(oData.consent){
- if(oData.consent.date.value){
- oData.consent.date.value = new Date(oData.consent.date.value);
- } else{
- oData.consent.date.value = undefined;
- }
- }
- if(oData.changeRequest){
- if(oData.changeRequest.changeDate.value){
- oData.changeRequest.changeDate.value = new Date(oData.changeRequest.changeDate.value);
- } else{
- oData.changeRequest.changeDate.value = undefined;
- }
- }
- return oData;
- },
- /**
- * This function sets date to utc timezone
- *
- * @author José Graça
- */
- setRetrievedDatesAsUTC: function(oData){
- if(oData.info){
- if(oData.info.dateOfBirth.value){
- oData.info.dateOfBirth.value = new Date(oData.info.dateOfBirth.value.getTime()+oData.info.dateOfBirth.value.getTimezoneOffset()*60000);
- }
- if(oData.info.healthCheckDate.value){
- oData.info.healthCheckDate.value = new Date(oData.info.healthCheckDate.value.getTime()+oData.info.healthCheckDate.value.getTimezoneOffset()*60000);
- }
- }
- if(oData.firstVisit){
- if(oData.firstVisit.dateBegin.value){
- oData.firstVisit.dateBegin.value = new Date(oData.firstVisit.dateBegin.value.getTime()+oData.firstVisit.dateBegin.value.getTimezoneOffset()*60000);
- }
- if(oData.firstVisit.dateEnd.value){
- oData.firstVisit.dateEnd.value = new Date(oData.firstVisit.dateEnd.value.getTime()+oData.firstVisit.dateEnd.value.getTimezoneOffset()*60000);
- }
- }
- if(oData.prescribingPhysician){
- if(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value){
- oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value = new Date(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value.getTime()+oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value.getTimezoneOffset()*60000);
- }
- for(var i in oData.prescribingPhysician.prescribingDoctor){
- if(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value){
- oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value = new Date(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value.getTime()+oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value.getTimezoneOffset()*60000);
- }
- if(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value){
- oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value = new Date(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value.getTime()+oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value.getTimezoneOffset()*60000);
- }
- }
- }
- if(oData.dischargeInstitution){
- if(oData.dischargeInstitution.dischargeDate.value){
- oData.dischargeInstitution.dischargeDate.value = new Date(oData.dischargeInstitution.dischargeDate.value.getTime()+oData.dischargeInstitution.dischargeDate.value.getTimezoneOffset()*60000);
- }
- }
- if(oData.consent){
- if(oData.consent.date.value){
- oData.consent.date.value = new Date(oData.consent.date.value.getTime()+oData.consent.date.value.getTimezoneOffset()*60000);
- }
- }
- if(oData.changeRequest){
- if(oData.changeRequest.changeDate.value){
- oData.changeRequest.changeDate.value = new Date(oData.changeRequest.changeDate.value.getTime()+oData.changeRequest.changeDate.value.getTimezoneOffset()*60000);
- }
- }
- return oData;
- },
- /**
- * This function transforms all the dates to a string in the format to send
- *
- * @author José Graça
- */
- prepareDatesToSend: function(oData) {
- var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({
- pattern: "yyyy-MM-ddTKK:mm:ss"
- });
- if(oData.info){
- if(oData.info.dateOfBirth.value){
- oData.info.dateOfBirth.value = oDateFormat.format(oData.info.dateOfBirth.value);
- }
- if(oData.info.healthCheckDate.value){
- oData.info.healthCheckDate.value = oDateFormat.format(oData.info.healthCheckDate.value);
- }
- }
- if(oData.firstVisit){
- if(oData.firstVisit.dateBegin.value){
- oData.firstVisit.dateBegin.value = oDateFormat.format(oData.firstVisit.dateBegin.value);
- }
- if(oData.firstVisit.dateEnd.value){
- oData.firstVisit.dateEnd.value = oDateFormat.format(oData.firstVisit.dateEnd.value);
- }
- }
- if(oData.prescribingPhysician){
- if(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value){
- oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value = oDateFormat.format(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value);
- }
- for(var i in oData.prescribingPhysician.prescribingDoctor){
- if(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value){
- oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value = oDateFormat.format(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value);
- }
- if(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value){
- oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value = oDateFormat.format(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value);
- }
- }
- }
- if(oData.dischargeInstitution){
- if(oData.dischargeInstitution.dischargeDate.value){
- oData.dischargeInstitution.dischargeDate.value = oDateFormat.format(oData.dischargeInstitution.dischargeDate.value);
- }
- }
- if(oData.consent){
- if(oData.consent.date.value){
- oData.consent.date.value = oDateFormat.format(oData.consent.date.value);
- }
- }
- if(oData.changeRequest){
- if(oData.changeRequest.changeDate.value){
- oData.changeRequest.changeDate.value = oDateFormat.format(oData.changeRequest.changeDate.value);
- }
- }
- return oData;
- },
- //Start - DHC-1588 - Code Insert - Maridine Reyes - 12-15-2016
- navToWoundOverview: function(){
- this.getRouter().navTo("WoundOverview");
- },
- //End - DHC-1588 - Code Insert - Maridine Reyes - 12-15-2016
- //Start - DHC-1658 - Code Insert - Maridine Reyes - 01/05/2017
- navToWoundStatus: function(){
- this.getRouter().navTo("WoundStatus");
- },
- navToWoundConsent: function(){
- this.getRouter().navTo("WoundConsent");
- },
- navToWoundComment: function(photosnr){
- this.getRouter().navTo("WoundComment", {
- photosnr: photosnr
- });
- }
- //End - DHC-1658 - Code Insert - Maridine Reyes - 01/05/2017
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement