Advertisement
Guest User

BaseController

a guest
Jan 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 127.11 KB | None | 0 0
  1. /**
  2. * BaseController Controller (V1.0):
  3. *
  4. *
  5. * @author
  6. */
  7. sap.ui.define([
  8. "sap/ui/core/mvc/Controller",
  9. "sap/ui/core/routing/History"
  10. ], function(Controller, History) {
  11. "use strict";
  12.  
  13. /* Maria Elise Martin inserted the following code 11/10/16 */
  14. var woundParam;
  15. /* Maria Elise Martin end of change 11/10/16 */
  16.  
  17. return Controller.extend("FS_WS_PDM_DEMO.controller.common.BaseController", {
  18.  
  19. /**
  20. * Getter for the Controlers Model
  21. * Can be used to add/access any controller from the other app controllers
  22. *
  23. * @author
  24. */
  25. getControllersModel: function() {
  26. return sap.ui.getCore().getModel("controllers").getData();
  27. },
  28.  
  29. /**
  30. * Setter for the Controlers Model
  31. * Can be used to add/access any controller from the other app controllers
  32. *
  33. * @author
  34. */
  35. setControllersModel: function(sControllers) {
  36. var oControlModel = new sap.ui.model.json.JSONModel(sControllers);
  37. sap.ui.getCore().setModel(oControlModel, "controllers");
  38. },
  39.  
  40. /**
  41. * Function that opens sidebar menu
  42. *
  43. * @author
  44. */
  45. openMenu: function() {
  46. var oShell = this.getControllersModel().app.getView().byId("ushell");
  47. //var oShell = this.getRouter().getView("FS_WS_PDM_DEMO.view.dashboard.Main").getParent().getParent().getParent();
  48. //var oShell = window.appController.getView().byId("ushell");
  49. var bState = oShell.getShowPane();
  50. oShell.setShowPane(!bState);
  51.  
  52. /*if (!bState) {
  53. var blocklayer = new sap.ui.xmlfragment("FS_WS_PDM_DEMO.fragment.common.blocklayer", this);
  54. this.getView().byId("homepage").addContent(blocklayer);
  55. } else {
  56. jQuery.sap.delayedCall(500, this, function() {
  57. this.getView().byId("homepage").removeContent(this.getView().byId("homepage").getContent().length - 1);
  58. });
  59.  
  60. }*/
  61. },
  62.  
  63. /**
  64. * Navigation function used to navigate to previous page
  65. *
  66. * @author
  67. */
  68. onNavBackReturn: function() {
  69. var bRes;
  70. var oHistory = History.getInstance();
  71. var sPreviousHash = oHistory.getPreviousHash();
  72.  
  73. if (sPreviousHash !== undefined) {
  74. window.history.go(-1);
  75. bRes = true;
  76. } else {
  77. // this.getRouter().navTo("Main", true);
  78. bRes = false;
  79. }
  80. return bRes;
  81. },
  82.  
  83. /**
  84. * Default function to expand and retract panels
  85. * Does nothing if the arrow is pointing to the right (navigation arrow)
  86. *
  87. * @author
  88. */
  89. toggleExpandablePanel: function(oEvent) {
  90. var oBtn = oEvent.getSource();
  91.  
  92. //do not expand if btn is used to navigate to next page (right arrow icon)
  93. if (oBtn.getIcon() !== "sap-icon://slim-arrow-right") {
  94.  
  95. var oPanel = oBtn.getParent().getParent().getParent().getParent();
  96. var isExpanded = oPanel.getExpanded();
  97.  
  98. if (isExpanded) oBtn.setIcon("sap-icon://slim-arrow-down");
  99. else oBtn.setIcon("sap-icon://slim-arrow-up");
  100.  
  101. oPanel.setExpanded(!isExpanded);
  102. } else {
  103. //use this function on the respective controller
  104. try {
  105. this.togglePanelNavigation();
  106. } catch (e) {
  107. //function not defined
  108. }
  109. }
  110. },
  111.  
  112. /**
  113. * Function that deletes the "edit" icon from the panel and changes
  114. * the expand btn to become a "navigation arrow"
  115. *
  116. * @author
  117. */
  118. setNavigationArrow: function(oPanel) {
  119. var oFlex = oPanel.getHeaderToolbar().getContent()[0].getItems()[2];
  120. var oEditicon = oFlex.getItems()[0];
  121. var oExpandbtn = oFlex.getItems()[1];
  122.  
  123. oFlex.setJustifyContent("Center");
  124. oEditicon.destroy();
  125. oExpandbtn.setIcon("sap-icon://slim-arrow-right");
  126. },
  127.  
  128. /**
  129. * Navigation function used to navigate to previous page,
  130. * or Home page in case that doesnt exists
  131. *
  132. * @author
  133. */
  134. onNavBack: function() {
  135. var oHistory = History.getInstance();
  136. var sPreviousHash = oHistory.getPreviousHash();
  137.  
  138. if (sPreviousHash !== undefined) {
  139. window.history.go(-1);
  140. } else {
  141. this.getRouter().navTo("Main", true);
  142. }
  143. },
  144.  
  145. /**
  146. * Navigation function used to navigate to Home page
  147. *
  148. * @author
  149. */
  150. navHome: function() {
  151. this.getRouter().navTo("Main");
  152. },
  153.  
  154. /**
  155. * Navigation function used to navigate to Discharge page
  156. *
  157. * @author
  158. */
  159. navToDischarge: function() {
  160. this.getRouter().navTo("Discharge");
  161. },
  162.  
  163. /**
  164. * Navigation function used to navigate to Therapy page
  165. *
  166. * @author
  167. */
  168. navToTherapy: function() {
  169. this.getRouter().navTo("Therapy");
  170. },
  171.  
  172. /**
  173. * Navigation function used to navigate to WVDocuments page
  174. *
  175. * @author
  176. */
  177. navToWVDocuments: function() {
  178. this.getRouter().navTo("WVDocuments");
  179. },
  180.  
  181. /**
  182. * Navigation function used to navigate to WVTherapy page
  183. *
  184. * @author
  185. */
  186. navToWVTherapy: function(sWound) {
  187. this.getRouter().navTo("WVTherapy", {
  188. wound: sWound
  189. });
  190. },
  191.  
  192. //Start - DHC-1588 - Code Insert - Maridine Reyes - 12-15-2016
  193. navToWoundOverview: function(){
  194. this.getRouter().navTo("WoundOverview");
  195. },
  196. //End - DHC-1588 - Code Insert - Maridine Reyes - 12-15-2016
  197.  
  198. /* Ruther So Start of change 01/04/2017 */
  199. navToStatusUpdateEnteralNutrition: function() {
  200. this.getRouter().navTo("StatusUpdateEnteralNutrition");
  201. },
  202. /* Ruther So End of change 01/04/2017 */
  203.  
  204. /* Elray Jun Amplayo Start of change 01/05/2017 */
  205. navToEnterDiagnosis: function() {
  206. this.getRouter().navTo("EnterDiagnosis");
  207. },
  208. /* Elray Jun Amplayo End of change 01/05/2017 */
  209.  
  210. /*
  211. * Navigation functions: used to navigate to different pages
  212. */
  213. /* Jj Kida start of change 11/17/16 */
  214. /**
  215. * Navigation function used to navigate to MedicalAssessment1 page
  216. * according to the string wound received
  217. *
  218. * @author
  219. */
  220. navToMedical1: function(sWound) {
  221. this.getRouter().navTo("MedicalAssessment1", {
  222. wound: sWound
  223. });
  224. },
  225.  
  226. /**
  227. * Navigation function used to navigate to MedicalAssessment2 page
  228. * according to the string wound received
  229. *
  230. * @author
  231. */
  232. navToMedical2: function(sWound) {
  233. this.getRouter().navTo("MedicalAssessment2", {
  234. wound: sWound
  235. });
  236. },
  237.  
  238. /**
  239. * Navigation function used to navigate to MedicalAssessment3 page
  240. * according to the string wound received
  241. *
  242. * @author
  243. */
  244. navToMedical3: function(sWound) {
  245. this.getRouter().navTo("MedicalAssessment3", {
  246. wound: sWound
  247. });
  248. },
  249.  
  250. /**
  251. * Navigation function used to navigate to MedicalAssessment4 page
  252. * according to the string wound received
  253. *
  254. * @author
  255. */
  256. navToMedical4: function(sWound) {
  257. this.getRouter().navTo("MedicalAssessment4", {
  258. wound: sWound
  259. });
  260. },
  261. /* Jj Kida end of change 11/17/16 */
  262.  
  263. /**
  264. * Navigation function used to navigate to OrderConfirmation page
  265. * according to the object property and integer index received
  266. *
  267. * @author
  268. */
  269. navToOrderConfirmation: function(oProperty, iIndex) {
  270. this.getRouter().navTo("OrderConfirmation", {
  271. property: oProperty,
  272. index: iIndex
  273. });
  274. },
  275.  
  276. /**
  277. * Navigation function used to navigate to ShoppingCart page
  278. * according to the object property and integer index received
  279. *
  280. * @author
  281. */
  282. navToShoppingCart: function(oProperty, iIndex) {
  283. this.getRouter().navTo("ShoppingCart", {
  284. property: oProperty,
  285. index: iIndex
  286. });
  287. },
  288.  
  289. /**
  290. * Navigation function used to navigate to Overview page
  291. *
  292. * @author
  293. */
  294. navToOverview: function() {
  295. this.getRouter().navTo("Overview");
  296. },
  297.  
  298. /**
  299. * Navigation function used to call the navToOverview function
  300. *
  301. * @author
  302. */
  303. navToOverviewViaSidebar: function() {
  304. this.openMenu();
  305. this.navToOverview();
  306. },
  307.  
  308. /**
  309. * Navigation function used to navigate to PrefilledPrescription page
  310. * according to the object button, object property and integer index received
  311. *
  312. * @author
  313. */
  314. navToPrefilledPrescription: function(oButton, oProperty, iIndex) {
  315. this.getRouter().navTo("PrefilledPrescription", {
  316. button: oButton,
  317. property: oProperty,
  318. index: iIndex
  319. });
  320. },
  321.  
  322. /**
  323. * Navigation function used to navigate to WVStatus page
  324. * according to the string wound received
  325. *
  326. * @author
  327. */
  328. navToWVStatus: function(sWound) {
  329. this.getRouter().navTo("WVStatus", {
  330. wound: sWound
  331. });
  332. },
  333.  
  334. /**
  335. * Navigation function used to navigate to WVTherapyEdit page
  336. * according to the string wound and additional received
  337. *
  338. * @author
  339. */
  340. navToWVTherapyEdit: function(sWound, sAdditional) {
  341. this.getRouter().navTo("WVTherapyEdit", {
  342. wound: sWound,
  343. additional: sAdditional
  344. });
  345. },
  346.  
  347. /**
  348. * Navigation function used to navigate to previous Therapy
  349. * document according to the history
  350. *
  351. * @author
  352. */
  353. therapyNavBack: function() {
  354. var oHistory = History.getInstance();
  355. //var sPreviousHash = window.hasher.getHashAsArray()[0];
  356. var sPreviousHash = oHistory.getPreviousHash();
  357.  
  358. if (/WVDocuments/.test(sPreviousHash)) {
  359. this.navToWVDocuments();
  360. } else if (sPreviousHash === "Therapy") {
  361. this.navToTherapy();
  362. } else {
  363. //default
  364. this.navToTherapy();
  365. }
  366.  
  367. },
  368.  
  369. /**
  370. * Navigation function used to navigate to PatientRequest page
  371. *
  372. * @author
  373. */
  374. navToPatientRequest: function() {
  375. this.getRouter().navTo("PatientRequest");
  376. },
  377.  
  378. /**
  379. * Navigation function used to navigate to Medical device page
  380. *
  381. * @Mark Martinez
  382. */
  383. navToMedicalDevice: function() {
  384. this.getRouter().navTo("MedicalDevice");
  385. },
  386.  
  387. //Start - DHC-2005 - Code Insert - Maria Elise Martin - 01-10-2017
  388. /**
  389. * Navigation function used to navigate to ViewPastVisits page
  390. *
  391. * @author Elise Martin
  392. */
  393. navToViewPastVisits: function(){
  394. this.getRouter().navTo("ViewPastVisits");
  395. },
  396. //End - DHC-2005 - Code Insert - Maria Elise Martin - 01-10-2017
  397.  
  398. /**
  399. * Navigation function used to navigate to Count Products page
  400. *
  401. * @author Karlo Marco D. Enero - Jan 11, 2017
  402. *
  403. * START OF CODING
  404. */
  405. navToCountProducts: function() {
  406. this.getRouter().navTo("CountProducts");
  407. },
  408.  
  409. /**
  410. * Function that returns the router for the current page
  411. *
  412. * @author
  413. */
  414. getRouter: function() {
  415. return sap.ui.core.UIComponent.getRouterFor(this);
  416. },
  417.  
  418. /**
  419. * Checks if the current device is an iOS device
  420. *
  421. * @author
  422. */
  423. isiOS: function() {
  424. return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
  425. },
  426.  
  427. /**
  428. * Checks if the current device is an Android device
  429. *
  430. * @author
  431. */
  432. isAndroid: function() {
  433. return /android/.test(navigator.userAgent) && !window.MSStream;
  434. },
  435.  
  436. /**
  437. * Function that generates a messagetoast for the received string text
  438. *
  439. * @author
  440. */
  441. toaster: function(sText) {
  442. sap.m.MessageToast.show(sText, {
  443. duration: 1000,
  444. width: "20em",
  445. my: "center bottom",
  446. at: "center bottom",
  447. of: window,
  448. offset: "0 0",
  449. collision: "fit fit",
  450. onClose: null,
  451. autoClose: true,
  452. animationTimingFunction: "ease",
  453. animationDuration: 2000,
  454. closeOnBrowserNavigation: true
  455. });
  456. },
  457.  
  458. /**
  459. * Function that load contacts data to core,
  460. * used in EditPatientContact View and CareLocationSituation View
  461. *
  462. * @author
  463. */
  464. loadNewPatientData: function() {
  465. if (sap.ui.getCore().getModel() === undefined ){//|| (sap.ui.getCore().getModel() !== undefined && sap.ui.getCore().getModel().getProperty("/patient")) ) {
  466. var data = {
  467. "patient": {
  468. "patientCheckStatus": 0,
  469. "checkSubmit": false,
  470. "changeRequest":{
  471. "changeDate":{
  472. "value": undefined,
  473. "mandatory": true,
  474. "updated": false
  475. },
  476. "changeReason":{
  477. "value": "",
  478. "mandatory": true,
  479. "updated": false
  480. },
  481. "inPatientMasterData": {
  482. "value": false,
  483. "mandatory": true,
  484. "updated": false
  485. },
  486. "rejectReason":{
  487. "value": "",
  488. "mandatory": true,
  489. "updated": false
  490. }
  491. },
  492. "info": {
  493. "id": {
  494. "value": "DHC_0001",
  495. "mandatory": false,
  496. "updated": false
  497. },
  498. "gender": {
  499. "value": 1,
  500. "mandatory": true,
  501. "updated": false
  502. },
  503. "firstName": {
  504. "value": "Hans",
  505. "mandatory": true,
  506. "updated": false
  507. },
  508. "lastName": {
  509. "value": "Mustermann",
  510. "mandatory": true,
  511. "updated": false
  512. },
  513. "dateOfBirth": {
  514. "value": new Date(456966000000),
  515. "mandatory": true,
  516. "updated": false
  517. },
  518. "datePatientRequest": {
  519. "value": "",
  520. "mandatory": false,
  521. "updated": false
  522. },
  523. "street": {
  524. "value": "",
  525. "mandatory": false,
  526. "updated": false
  527. },
  528. "additionalStreet": {
  529. "value": "",
  530. "mandatory": false,
  531. "updated": false
  532. },
  533. "access": {
  534. "value": "",
  535. "mandatory": false,
  536. "updated": false
  537. },
  538. "zipCode": {
  539. "value": "",
  540. "mandatory": false,
  541. "updated": false
  542. },
  543. "city": {
  544. "value": "",
  545. "mandatory": false,
  546. "updated": false
  547. },
  548. "tel": {
  549. "value": "030 111222333",
  550. "mandatory": false,
  551. "updated": false
  552. },
  553. "tels": [{
  554. "value": "030 111222444",
  555. "mandatory": false,
  556. "updated": false
  557. }, {
  558. "value": "030 111222555",
  559. "mandatory": false,
  560. "updated": false
  561. }],
  562. "fax": {
  563. "value": "030 111222",
  564. "mandatory": false,
  565. "updated": false
  566. },
  567. "email": {
  568. "value": "max@muller.de",
  569. "mandatory": false,
  570. "updated": false
  571. },
  572. "circumstancesaAtDischarge": {
  573. "value": "",
  574. "mandatory": false,
  575. "updated": false
  576. },
  577. "healthCheckDate": {
  578. "value": undefined,
  579. "mandatory": false,
  580. "updated": false
  581. },
  582. "therapeuticAreaPE": {
  583. "value": false,
  584. "mandatory": false,
  585. "updated": false
  586. },
  587. "therapeuticAreaEE": {
  588. "value": false,
  589. "mandatory": false,
  590. "updated": false
  591. },
  592. "therapeuticAreaWV": {
  593. "value": false,
  594. "mandatory": false,
  595. "updated": false
  596. },
  597. "therapeuticAreaTS": {
  598. "value": false,
  599. "mandatory": false,
  600. "updated": false
  601. },
  602. "height": {
  603. "value": "",
  604. "mandatory": true,
  605. "updated": false
  606. },
  607. "weight": {
  608. "value": "",
  609. "mandatory": true,
  610. "updated": false
  611. },
  612. "previousWeight": {
  613. "value": "",
  614. "mandatory": false,
  615. "updated": false
  616. },
  617. "bmi": {
  618. "value": "",
  619. "mandatory": true,
  620. "updated": false
  621. },
  622. "patientSick": {
  623. "value": false,
  624. "mandatory": false,
  625. "updated": false
  626. },
  627. "foodReduced": {
  628. "value": false,
  629. "mandatory": false,
  630. "updated": false
  631. },
  632. "lostWeight": {
  633. "value": false,
  634. "mandatory": false,
  635. "updated": false
  636. },
  637. "whereIsPatient": {
  638. "value": -1,
  639. "mandatory": true,
  640. "updated": false
  641. }, //0=Home, 1=Institution, 2=Other
  642. "acceptment": {
  643. "value": -1,
  644. "mandatory": true,
  645. "updated": false
  646. },
  647. "freeTextJustification": {
  648. "value": "",
  649. "mandatory": false,
  650. "updated": false
  651. },
  652. "accepted": {
  653. "value": false,
  654. "mandatory": false,
  655. "updated": false
  656. },
  657. "notCheckedSimilar": {
  658. "value": true,
  659. "mandatory": false,
  660. "updated": false
  661. },"mpiId": {
  662. "value": "",
  663. "mandatory": false,
  664. "updated": false
  665. },
  666. "patientStatus": {
  667. "value": 0,
  668. "mandatory": true,
  669. "updated": false
  670. }
  671. },
  672. "firstVisit": {
  673. "locationType": {
  674. "value": -1,
  675. "mandatory": true,
  676. "updated": false
  677. },
  678. "street": {
  679. "value": "",
  680. "mandatory": true,
  681. "updated": false
  682. },
  683. "additionalStreet": {
  684. "value": "",
  685. "mandatory": false,
  686. "updated": false
  687. },
  688. "zipCode": {
  689. "value": "",
  690. "mandatory": false,
  691. "updated": false
  692. },
  693. "city": {
  694. "value": "",
  695. "mandatory": false,
  696. "updated": false
  697. },
  698. "access": {
  699. "value": "",
  700. "mandatory": false,
  701. "updated": false
  702. },
  703. "dateBegin": {
  704. "value": undefined,
  705. "mandatory": true,
  706. "updated": false
  707. }, //"Tue Nov 25 2016 23:00:00 GMT+0000 (GMT Standard Time)",
  708. "dateEnd": {
  709. "value": undefined,
  710. "mandatory": true,
  711. "updated": false
  712. }, //"Tue Nov 24 2016 23:59:00 GMT+0000 (GMT Standard Time)",
  713. "initialDoctorSelected": {
  714. "value": false,
  715. "mandatory": false,
  716. "updated": false
  717. },
  718. "participants": [
  719. /*{
  720. "firstName" : "Max",
  721. "lastName": "Mullër",
  722. "info" : "",
  723. "isSelected" : true
  724.  
  725. },
  726. {
  727. "firstName" : "Ich",
  728. "lastName": "",
  729. "info" : "",
  730. "isSelected" : true
  731. }*/
  732. ]
  733. },
  734. "reportingInstitution": {
  735. "institution": {
  736. "value": "",
  737. "mandatory": true,
  738. "updated": false
  739. },
  740. "organization": {
  741. "value": "",
  742. "mandatory": true,
  743. "updated": false
  744. },
  745. "street": {
  746. "value": "",
  747. "mandatory": true,
  748. "updated": false
  749. },
  750. "additionalStreet": {
  751. "value": "",
  752. "mandatory": false,
  753. "updated": false
  754. },
  755. "tel": {
  756. "value": "",
  757. "mandatory": false,
  758. "updated": false
  759. },
  760. "fax": {
  761. "value": "",
  762. "mandatory": false,
  763. "updated": false
  764. },
  765. "email": {
  766. "value": "",
  767. "mandatory": false,
  768. "updated": false
  769. },
  770. "zipCode": {
  771. "value": "",
  772. "mandatory": false,
  773. "updated": false
  774. },
  775. "city": {
  776. "value": "",
  777. "mandatory": false,
  778. "updated": false
  779. }
  780. },
  781. "deliveryAddress": {
  782. "streetNew": {
  783. "value": "",
  784. "mandatory": true,
  785. "updated": false
  786. },
  787. "additionalStreetNew": {
  788. "value": "",
  789. "mandatory": false,
  790. "updated": false
  791. },
  792. "zipCodeNew": {
  793. "value": "",
  794. "mandatory": false,
  795. "updated": false
  796. },
  797. "cityNew": {
  798. "value": "",
  799. "mandatory": false,
  800. "updated": false
  801. },
  802. "addressOptions": {
  803. "value": -1,
  804. "mandatory": true,
  805. "updated": false
  806. },
  807. "receiver": {
  808. "value": "",
  809. "mandatory": true,
  810. "updated": false
  811. },
  812. "desiredVisitTimeFrom": {
  813. "value": "",
  814. "mandatory": false,
  815. "updated": false
  816. },
  817. "desiredVisitTimeTo": {
  818. "value": "",
  819. "mandatory": false,
  820. "updated": false
  821. }
  822. },
  823. "prescribingPhysician": {
  824. "previousDoctorFlag": {
  825. "value": false,
  826. "mandatory": false,
  827. "updated": false
  828. },
  829. "previvousPhysician": {
  830. "previousPhysicianType": {
  831. "value": -1,
  832. "mandatory": true,
  833. "updated": false
  834. }, // 0 = Doctor, 1 = Institution
  835. "previousInstitution": {
  836. "type": {
  837. "value": "",
  838. "mandatory": true,
  839. "updated": false
  840. },
  841. "name": {
  842. "value": "",
  843. "mandatory": true,
  844. "updated": false
  845. },
  846. "street": {
  847. "value": "",
  848. "mandatory": false,
  849. "updated": false
  850. },
  851. "additionalStreet": {
  852. "value": "",
  853. "mandatory": false,
  854. "updated": false
  855. },
  856. "zipCode": {
  857. "value": "",
  858. "mandatory": false,
  859. "updated": false
  860. },
  861. "city": {
  862. "value": "",
  863. "mandatory": false,
  864. "updated": false
  865. },
  866. "tel": {
  867. "value": "",
  868. "mandatory": false,
  869. "updated": false
  870. },
  871. "fax": {
  872. "value": "",
  873. "mandatory": false,
  874. "updated": false
  875. },
  876. "email": {
  877. "value": "",
  878. "mandatory": false,
  879. "updated": false
  880. },
  881. "details": {
  882. "value": "",
  883. "mandatory": false,
  884. "updated": false
  885. },
  886. "doctorGenre": {
  887. "value": -1,
  888. "mandatory": false,
  889. "updated": false
  890. },
  891. "doctorFirstName": {
  892. "value": "",
  893. "mandatory": false,
  894. "updated": false
  895. },
  896. "doctorLastName": {
  897. "value": "",
  898. "mandatory": false,
  899. "updated": false
  900. },
  901. "dischargeDate": {
  902. "value": undefined,
  903. "mandatory": false,
  904. "updated": false
  905. },
  906. "newFax": {
  907. "value": -1,
  908. "mandatory": false,
  909. "updated": false
  910. },
  911. "otherFax": {
  912. "value": "",
  913. "mandatory": false,
  914. "updated": false
  915. }
  916. },
  917. "previousDoctor": {
  918. "name": {
  919. "value": "",
  920. "mandatory": true,
  921. "updated": false
  922. },
  923. "speciality": {
  924. "value": "",
  925. "mandatory": true,
  926. "updated": false
  927. },
  928. "street": {
  929. "value": "",
  930. "mandatory": true,
  931. "updated": false
  932. },
  933. "additionalStreet": {
  934. "value": "",
  935. "mandatory": false,
  936. "updated": false
  937. },
  938. "zipCode": {
  939. "value": "",
  940. "mandatory": false,
  941. "updated": false
  942. },
  943. "city": {
  944. "value": "",
  945. "mandatory": false,
  946. "updated": false
  947. },
  948. "tel": {
  949. "value": "",
  950. "mandatory": false,
  951. "updated": false
  952. },
  953. "fax": {
  954. "value": "",
  955. "mandatory": false,
  956. "updated": false
  957. },
  958. "email": {
  959. "value": "",
  960. "mandatory": false,
  961. "updated": false
  962. },
  963. "timeSchedule": {
  964. "value": {
  965. 1: {
  966. morningOpen: "",
  967. morningClose: "",
  968. afternoonOpen: "",
  969. afternoonClose: ""
  970. },
  971. 2: {
  972. morningOpen: "",
  973. morningClose: "",
  974. afternoonOpen: "",
  975. afternoonClose: ""
  976. },
  977. 3: {
  978. morningOpen: "",
  979. morningClose: "",
  980. afternoonOpen: "",
  981. afternoonClose: ""
  982. },
  983. 4: {
  984. morningOpen: "",
  985. morningClose: "",
  986. afternoonOpen: "",
  987. afternoonClose: ""
  988. },
  989. 5: {
  990. morningOpen: "",
  991. morningClose: "",
  992. afternoonOpen: "",
  993. afternoonClose: ""
  994. }
  995. },
  996. "mandatory": false,
  997. "updated": false
  998. }
  999. }
  1000. },
  1001. "prescribingDoctor": [{
  1002. "name": {
  1003. "value": "",
  1004. "mandatory": true,
  1005. "updated": false
  1006. },
  1007. "speciality": {
  1008. "value": "",
  1009. "mandatory": true,
  1010. "updated": false
  1011. },
  1012. "street": {
  1013. "value": "",
  1014. "mandatory": true,
  1015. "updated": false
  1016. },
  1017. "additionalStreet": {
  1018. "value": "",
  1019. "mandatory": false,
  1020. "updated": false
  1021. },
  1022. "zipCode": {
  1023. "value": "",
  1024. "mandatory": false,
  1025. "updated": false
  1026. },
  1027. "city": {
  1028. "value": "",
  1029. "mandatory": false,
  1030. "updated": false
  1031. },
  1032. "tel": {
  1033. "value": "",
  1034. "mandatory": false,
  1035. "updated": false
  1036. },
  1037. "fax": {
  1038. "value": "",
  1039. "mandatory": false,
  1040. "updated": false
  1041. },
  1042. "email": {
  1043. "value": "",
  1044. "mandatory": false,
  1045. "updated": false
  1046. },
  1047. "timeSchedule": {
  1048. "value": {
  1049. 1: {
  1050. morningOpen: "",
  1051. morningClose: "",
  1052. afternoonOpen: "",
  1053. afternoonClose: ""
  1054. },
  1055. 2: {
  1056. morningOpen: "",
  1057. morningClose: "",
  1058. afternoonOpen: "",
  1059. afternoonClose: ""
  1060. },
  1061. 3: {
  1062. morningOpen: "",
  1063. morningClose: "",
  1064. afternoonOpen: "",
  1065. afternoonClose: ""
  1066. },
  1067. 4: {
  1068. morningOpen: "",
  1069. morningClose: "",
  1070. afternoonOpen: "",
  1071. afternoonClose: ""
  1072. },
  1073. 5: {
  1074. morningOpen: "",
  1075. morningClose: "",
  1076. afternoonOpen: "",
  1077. afternoonClose: ""
  1078. }
  1079. },
  1080. "mandatory": false,
  1081. "updated": false
  1082. },
  1083. "therapeuticAreaEE": {
  1084. "value": false,
  1085. "mandatory": false,
  1086. "updated": false
  1087. },
  1088. "therapeuticAreaPE": {
  1089. "value": false,
  1090. "mandatory": false,
  1091. "updated": false
  1092. },
  1093. "therapeuticAreaWV": {
  1094. "value": false,
  1095. "mandatory": false,
  1096. "updated": false
  1097. },
  1098. "therapeuticAreaTS": {
  1099. "value": false,
  1100. "mandatory": false,
  1101. "updated": false
  1102. },
  1103. "otherTherapeuticArea": {
  1104. "value": false,
  1105. "mandatory": false,
  1106. "updated": false
  1107. },
  1108. "holidays": {
  1109. "value": false,
  1110. "mandatory": false,
  1111. "updated": false
  1112. },
  1113. "holidaysFrom": {
  1114. "value": undefined,
  1115. "mandatory": false,
  1116. "updated": false
  1117. },
  1118. "holidaysTo": {
  1119. "value": undefined,
  1120. "mandatory": false,
  1121. "updated": false
  1122. },
  1123. "temporaryDoctor": {
  1124. "name": {
  1125. "value": "",
  1126. "mandatory": true,
  1127. "updated": false
  1128. },
  1129. "speciality": {
  1130. "value": "",
  1131. "mandatory": true,
  1132. "updated": false
  1133. },
  1134. "street": {
  1135. "value": "",
  1136. "mandatory": true,
  1137. "updated": false
  1138. },
  1139. "additionalStreet": {
  1140. "value": "",
  1141. "mandatory": false,
  1142. "updated": false
  1143. },
  1144. "zipCode": {
  1145. "value": "",
  1146. "mandatory": false,
  1147. "updated": false
  1148. },
  1149. "city": {
  1150. "value": "",
  1151. "mandatory": false,
  1152. "updated": false
  1153. },
  1154. "tel": {
  1155. "value": "",
  1156. "mandatory": false,
  1157. "updated": false
  1158. },
  1159. "fax": {
  1160. "value": "",
  1161. "mandatory": false,
  1162. "updated": false
  1163. },
  1164. "email": {
  1165. "value": "",
  1166. "mandatory": false,
  1167. "updated": false
  1168. },
  1169. "timeSchedule": {
  1170. "value": {
  1171. 1: {
  1172. morningOpen: "",
  1173. morningClose: "",
  1174. afternoonOpen: "",
  1175. afternoonClose: ""
  1176. },
  1177. 2: {
  1178. morningOpen: "",
  1179. morningClose: "",
  1180. afternoonOpen: "",
  1181. afternoonClose: ""
  1182. },
  1183. 3: {
  1184. morningOpen: "",
  1185. morningClose: "",
  1186. afternoonOpen: "",
  1187. afternoonClose: ""
  1188. },
  1189. 4: {
  1190. morningOpen: "",
  1191. morningClose: "",
  1192. afternoonOpen: "",
  1193. afternoonClose: ""
  1194. },
  1195. 5: {
  1196. morningOpen: "",
  1197. morningClose: "",
  1198. afternoonOpen: "",
  1199. afternoonClose: ""
  1200. }
  1201. },
  1202. "mandatory": false,
  1203. "updated": false
  1204. }
  1205. }
  1206. }]
  1207. },
  1208. "dischargeInstitution": {
  1209. "type": {
  1210. "value": "",
  1211. "mandatory": true,
  1212. "updated": false
  1213. },
  1214. "name": {
  1215. "value": "",
  1216. "mandatory": true,
  1217. "updated": false
  1218. },
  1219. "street": {
  1220. "value": "",
  1221. "mandatory": true,
  1222. "updated": false
  1223. },
  1224. "additionalStreet": {
  1225. "value": "",
  1226. "mandatory": false,
  1227. "updated": false
  1228. },
  1229. "zipCode": {
  1230. "value": "",
  1231. "mandatory": false,
  1232. "updated": false
  1233. },
  1234. "city": {
  1235. "value": "",
  1236. "mandatory": false,
  1237. "updated": false
  1238. },
  1239. "tel": {
  1240. "value": "",
  1241. "mandatory": false,
  1242. "updated": false
  1243. },
  1244. "fax": {
  1245. "value": "",
  1246. "mandatory": false,
  1247. "updated": false
  1248. },
  1249. "email": {
  1250. "value": "",
  1251. "mandatory": false,
  1252. "updated": false
  1253. },
  1254. "details": {
  1255. "value": "",
  1256. "mandatory": false,
  1257. "updated": false
  1258. },
  1259. "doctorGenre": {
  1260. "value": -1,
  1261. "mandatory": false,
  1262. "updated": false
  1263. },
  1264. "doctorFirstName": {
  1265. "value": "",
  1266. "mandatory": false,
  1267. "updated": false
  1268. },
  1269. "doctorLastName": {
  1270. "value": "",
  1271. "mandatory": false,
  1272. "updated": false
  1273. },
  1274. "dischargeDate": {
  1275. "value": undefined,
  1276. "mandatory": false,
  1277. "updated": false
  1278. },
  1279. "newFax": {
  1280. "value": -1,
  1281. "mandatory": false,
  1282. "updated": false
  1283. },
  1284. "otherFax": {
  1285. "value": "",
  1286. "mandatory": false,
  1287. "updated": false
  1288. }
  1289. },
  1290. "careSituation": {
  1291. "careSituationType": {
  1292. "value": 0,
  1293. "mandatory": true,
  1294. "updated": false
  1295. }, // 0 = "Eigene Hauslichkeit", 1 = Ambulante Pflege , 2 = Plegeheim
  1296. "name": {
  1297. "value": "",
  1298. "mandatory": true,
  1299. "updated": false
  1300. },
  1301. "street": {
  1302. "value": "",
  1303. "mandatory": true,
  1304. "updated": false
  1305. },
  1306. "additionalStreet": {
  1307. "value": "",
  1308. "mandatory": false,
  1309. "updated": false
  1310. },
  1311. "zipCode": {
  1312. "value": "",
  1313. "mandatory": false,
  1314. "updated": false
  1315. },
  1316. "city": {
  1317. "value": "",
  1318. "mandatory": false,
  1319. "updated": false
  1320. },
  1321. "tel": {
  1322. "value": "",
  1323. "mandatory": false,
  1324. "updated": false
  1325. },
  1326. "fax": {
  1327. "value": "",
  1328. "mandatory": false,
  1329. "updated": false
  1330. },
  1331. "email": {
  1332. "value": "",
  1333. "mandatory": false,
  1334. "updated": false
  1335. },
  1336. "access": {
  1337. "value": "",
  1338. "mandatory": false,
  1339. "updated": false
  1340. },
  1341. "farFromStreet": {
  1342. "value": false,
  1343. "mandatory": false,
  1344. "updated": false
  1345. },
  1346. "withoutElevator": {
  1347. "value": false,
  1348. "mandatory": false,
  1349. "updated": false
  1350. },
  1351. "notForWheelchair": {
  1352. "value": false,
  1353. "mandatory": false,
  1354. "updated": false
  1355. },
  1356. "parkingMorning": {
  1357. "value": 0,
  1358. "mandatory": false,
  1359. "updated": false
  1360. },
  1361. "parkingNoon": {
  1362. "value": 0,
  1363. "mandatory": false,
  1364. "updated": false
  1365. },
  1366. "parkingEvening": {
  1367. "value": 0,
  1368. "mandatory": false,
  1369. "updated": false
  1370. },
  1371. "desiredVisitTimeFrom": {
  1372. "value": "",
  1373. "mandatory": false,
  1374. "updated": false
  1375. },
  1376. "desiredVisitTimeTo": {
  1377. "value": "",
  1378. "mandatory": false,
  1379. "updated": false
  1380. }
  1381. },
  1382. "livingConditionsInfo": {
  1383. "data": {
  1384. "value": -1,
  1385. "mandatory": true,
  1386. "updated": false
  1387. }, //REQ
  1388. "spaceCare": {
  1389. "value": false,
  1390. "mandatory": false,
  1391. "updated": false
  1392. },
  1393. "spaceRefrigerator": {
  1394. "value": false,
  1395. "mandatory": false,
  1396. "updated": false
  1397. },
  1398. "spaceGadgets": {
  1399. "value": false,
  1400. "mandatory": false,
  1401. "updated": false
  1402. },
  1403. "spaceProductBoxes": {
  1404. "value": false,
  1405. "mandatory": false,
  1406. "updated": false
  1407. },
  1408. "thereIsWater": {
  1409. "value": false,
  1410. "mandatory": false,
  1411. "updated": false
  1412. },
  1413. "thereIsElectricity": {
  1414. "value": false,
  1415. "mandatory": false,
  1416. "updated": false
  1417. },
  1418. "thereIsPets": {
  1419. "value": false,
  1420. "mandatory": false,
  1421. "updated": false
  1422. }
  1423. },
  1424. "patientContacts": [
  1425. /*{
  1426. "gender": 0,
  1427. "firstName": "Leilar",
  1428. "lastName": "Muller",
  1429. "street": "Straußmannstr. 168",
  1430. "additionalStreet": "",
  1431. "zipCode": "12047",
  1432. "city": "Berlin-Neukölln",
  1433. "tel": "0221 668 668 25",
  1434. "tels": [],
  1435. "fax": "0221 668 668 44",
  1436. "email": "leilar@muller.de",
  1437. "institutionName": "",
  1438. "type": 0,
  1439. "livesWith": false,
  1440. "isLegalGuardian": false,
  1441. "isPersonContact": false,
  1442. "firstVisit": false
  1443. },
  1444. {
  1445. "gender": 1,
  1446. "firstName": "Struck",
  1447. "lastName": "Blau",
  1448. "street": "Blaumannstr. n.º168",
  1449. "additionalStreet": "",
  1450. "zipCode": "12047",
  1451. "city": "Berlin-Neukölln",
  1452. "tel": "030 65656500",
  1453. "tels": [
  1454. {"tel": "0221 668 333 34"}
  1455. ],
  1456. "fax": "030 65656501",
  1457. "email": "struck@blau.de",
  1458. "institutionName": "",
  1459. "type": 1,
  1460. "livesWith": true,
  1461. "isLegalGuardian": true,
  1462. "isPersonContact": false,
  1463. "firstVisit": false
  1464. },
  1465. {
  1466. "gender": 0,
  1467. "firstName": "Manuella",
  1468. "lastName": "Sommer",
  1469. "street": "Straußmannstr. 168",
  1470. "additionalStreet": "",
  1471. "zipCode": "12047",
  1472. "city": "Berlin-Neukölln",
  1473. "tel": "0221 668 778 25",
  1474. "tels": [
  1475. {"tel": "0221 668 333 34"}
  1476. ],
  1477. "fax": "0221 668 778 44",
  1478. "email": "manuella@sommer.de",
  1479. "institutionName": "",
  1480. "type": 1,
  1481. "livesWith": true,
  1482. "isLegalGuardian": false,
  1483. "isPersonContact": true,
  1484. "firstVisit": false
  1485. },
  1486. {
  1487. "gender": 0,
  1488. "firstName": "Manuella",
  1489. "lastName": "Sommer",
  1490. "street": "Straußmannstr. 168",
  1491. "additionalStreet": "",
  1492. "zipCode": "12047",
  1493. "city": "Berlin-Neukölln",
  1494. "tel": "0221 668 668 25",
  1495. "tels": [
  1496. {"tel": "0221 668 333 34"}
  1497. ],
  1498. "fax": "0221 668 668 44",
  1499. "email": "kontakt@hkk.de",
  1500. "institutionName": "HKK",
  1501. "type": 3,
  1502. "livesWith": false,
  1503. "isLegalGuardian": false,
  1504. "isPersonContact": false,
  1505. "firstVisit": false
  1506. }*/
  1507. ],
  1508. "pharmacy": {
  1509. "name": {
  1510. "value": "",
  1511. "mandatory": true,
  1512. "updated": false
  1513. },
  1514. "street": {
  1515. "value": "",
  1516. "mandatory": true,
  1517. "updated": false
  1518. },
  1519. "additionalStreet": {
  1520. "value": "",
  1521. "mandatory": false,
  1522. "updated": false
  1523. },
  1524. "zipCode": {
  1525. "value": "",
  1526. "mandatory": false,
  1527. "updated": false
  1528. },
  1529. "city": {
  1530. "value": "",
  1531. "mandatory": false,
  1532. "updated": false
  1533. },
  1534. "tel": {
  1535. "value": "",
  1536. "mandatory": false,
  1537. "updated": false
  1538. },
  1539. "fax": {
  1540. "value": "",
  1541. "mandatory": false,
  1542. "updated": false
  1543. },
  1544. "email": {
  1545. "value": "",
  1546. "mandatory": false,
  1547. "updated": false
  1548. },
  1549. "timeSchedule": {
  1550. "value": {
  1551. 1: {
  1552. morningOpen: "",
  1553. morningClose: "",
  1554. afternoonOpen: "",
  1555. afternoonClose: ""
  1556. },
  1557. 2: {
  1558. morningOpen: "",
  1559. morningClose: "",
  1560. afternoonOpen: "",
  1561. afternoonClose: ""
  1562. },
  1563. 3: {
  1564. morningOpen: "",
  1565. morningClose: "",
  1566. afternoonOpen: "",
  1567. afternoonClose: ""
  1568. },
  1569. 4: {
  1570. morningOpen: "",
  1571. morningClose: "",
  1572. afternoonOpen: "",
  1573. afternoonClose: ""
  1574. },
  1575. 5: {
  1576. morningOpen: "",
  1577. morningClose: "",
  1578. afternoonOpen: "",
  1579. afternoonClose: ""
  1580. }
  1581. },
  1582. "mandatory": false,
  1583. "updated": false
  1584. }
  1585. },
  1586. "insurance": {
  1587. "institutionName": {
  1588. "value": "",
  1589. "mandatory": true,
  1590. "updated": false
  1591. },
  1592. "street": {
  1593. "value": "",
  1594. "mandatory": true,
  1595. "updated": false
  1596. },
  1597. "zipCode": {
  1598. "value": "",
  1599. "mandatory": false,
  1600. "updated": false
  1601. },
  1602. "city": {
  1603. "value": "",
  1604. "mandatory": false,
  1605. "updated": false
  1606. },
  1607. "tel": {
  1608. "value": "",
  1609. "mandatory": false,
  1610. "updated": false
  1611. },
  1612. "fax": {
  1613. "value": "",
  1614. "mandatory": false,
  1615. "updated": false
  1616. },
  1617. "email": {
  1618. "value": "",
  1619. "mandatory": false,
  1620. "updated": false
  1621. },
  1622. "memberShipNumber": {
  1623. "value": "",
  1624. "mandatory": false,
  1625. "updated": false
  1626. },
  1627. "type": {
  1628. "value": -1,
  1629. "mandatory": true,
  1630. "updated": false
  1631. },
  1632. "paymentStatus": {
  1633. "value": false,
  1634. "mandatory": true,
  1635. "updated": false
  1636. },
  1637. "uploadedPayment": {
  1638. "value": false,
  1639. "mandatory": true,
  1640. "updated": false
  1641. },
  1642. "uploadedDatePayment": {
  1643. "value": "",
  1644. "mandatory": false,
  1645. "updated": false
  1646. },
  1647. "payers": {
  1648. "value": false,
  1649. "mandatory": true,
  1650. "updated": false
  1651. },
  1652. "uploadedPayers": {
  1653. "value": false,
  1654. "mandatory": true,
  1655. "updated": false
  1656. },
  1657. "uploadedDatePayers": {
  1658. "value": "",
  1659. "mandatory": false,
  1660. "updated": false
  1661. },
  1662. "careLevel": {
  1663. "value": false,
  1664. "mandatory": false,
  1665. "updated": false
  1666. }
  1667. },
  1668. "consent": {
  1669. "care": {
  1670. "value": false,
  1671. "mandatory": false,
  1672. "updated": false
  1673. },
  1674. "data": {
  1675. "value": false,
  1676. "mandatory": false,
  1677. "updated": false
  1678. },
  1679. "photographic": {
  1680. "value": false,
  1681. "mandatory": false,
  1682. "updated": false
  1683. },
  1684. "telephone": {
  1685. "value": false,
  1686. "mandatory": false,
  1687. "updated": false
  1688. },
  1689. "revoke": {
  1690. "value": false,
  1691. "mandatory": false,
  1692. "updated": false
  1693. },
  1694. "date": {
  1695. "value": undefined,
  1696. "mandatory": false,
  1697. "updated": false
  1698. }
  1699. }
  1700. }
  1701. };
  1702.  
  1703. var oModel = new sap.ui.model.json.JSONModel();
  1704. oModel.setData(data);
  1705. sap.ui.getCore().setModel(oModel);
  1706. }
  1707. },
  1708.  
  1709. /**
  1710. * Function that adds existing patient data to PatientModel,
  1711. *
  1712. * @author
  1713. */
  1714. addExistingPatientData: function() {
  1715. var oData = {
  1716. "patients": [{
  1717. "id": "1",
  1718. "Name": "Maike",
  1719. "Last_Name": "Stephen",
  1720. "Birth_Date": "03.11.1931",
  1721. "Last_Update": new Date("01/12/2016"),
  1722. "Gender": "M",
  1723. "Building": "Gebaude 2, Zimmer 255",
  1724. "Street": "Sunshinestrasse 125, 12855 Berlin",
  1725. "Delivery_Time": "Wunschlieferzeit 08:00AM-08:00PM",
  1726. "Image": "resources/common/assets/profile-circle.svg",
  1727. "DoctorName_TS": "Ann Stein",
  1728. "DoctorGender_TS": "M",
  1729. "DoctorName_EE": "Max Muller",
  1730. "DoctorGender_EE": "M",
  1731. "DoctorName_PE": "Carl Stein",
  1732. "DoctorGender_PE": "M",
  1733. "DoctorName_WV": "Rachel Muller",
  1734. "DoctorGender_WV": "F",
  1735. "Last_Prescription": "No",
  1736. "therapeuticAreaTS": true,
  1737. "therapeuticAreaEE": true,
  1738. "therapeuticAreaPE": false,
  1739. "therapeuticAreaWV": true,
  1740. "Therapy_Plan": {
  1741. "TS": true,
  1742. "EE": true,
  1743. "PE": false,
  1744. "WV": true,
  1745. "Non_Prescription": [{
  1746.  
  1747. "id": "00000",
  1748. "Name": "Fresubin 2 kcal Fibre Drink",
  1749. "Description": "Lemon 4x200 ml EasyDrink",
  1750. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1751. "Payer_Condition": "Selbstzahler",
  1752. "Therapeutic_Plan": "EE",
  1753. "Quantity": 3,
  1754. "Stock": 10,
  1755. "Delivery_Date": "25.12.2016",
  1756. "Alternatives": [{
  1757.  
  1758. "id": "00003",
  1759. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
  1760. "Description": "Lemon 4x200 ml EasyDrink",
  1761. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1762. "Payer_Condition": "Selbstzahler",
  1763. "Therapeutic_Plan": "EE",
  1764. "Quantity": 3,
  1765. "Stock": 10,
  1766. "Delivery_Date": "10.12.2016"
  1767.  
  1768. }, {
  1769.  
  1770. "id": "00004",
  1771. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
  1772. "Description": "Lemon 4x200 ml EasyDrink",
  1773. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1774. "Payer_Condition": "Selbstzahler",
  1775. "Therapeutic_Plan": "EE",
  1776. "Quantity": 3,
  1777. "Stock": 10,
  1778. "Delivery_Date": "11.12.2016"
  1779.  
  1780. }]
  1781.  
  1782. }, {
  1783. "id": "00001",
  1784. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
  1785. "Description": "12x28 ml pack",
  1786. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  1787. "Payer_Condition": "Selbstzahler",
  1788. "Therapeutic_Plan": "TS",
  1789. "Quantity": 4,
  1790. "Stock": 15,
  1791. "Delivery_Date": "26.12.2016",
  1792. "Alternatives": [{
  1793. "id": "00005",
  1794. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack ALTERNATIVE 1",
  1795. "Description": "12x28 ml pack",
  1796. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  1797. "Payer_Condition": "Selbstzahler",
  1798. "Therapeutic_Plan": "TS",
  1799. "Quantity": 4,
  1800. "Stock": 15,
  1801. "Delivery_Date": "24.12.2016"
  1802. }]
  1803. }, {
  1804. "id": "00002",
  1805. "Name": "Mudan Fresan",
  1806. "Description": "Neutral 1x450g Dose",
  1807. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  1808. "Payer_Condition": "Selbstzahler",
  1809. "Therapeutic_Plan": "EE",
  1810. "Quantity": 4,
  1811. "Stock": 20,
  1812. "Delivery_Date": "23.12.2016",
  1813. "Alternatives": [{
  1814. "id": "00007",
  1815. "Name": "Mudan Fresan ALTERNATIVE 1",
  1816. "Description": "Neutral 1x450g Dose",
  1817. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  1818. "Payer_Condition": "Selbstzahler",
  1819. "Therapeutic_Plan": "EE",
  1820. "Quantity": 4,
  1821. "Stock": 15,
  1822. "Delivery_Date": "22.12.2016"
  1823. }]
  1824. }],
  1825. "Prescription_EE": [],
  1826. "Prescription_PE": [],
  1827. "Prescription_TS": [{
  1828.  
  1829. "id": "00000",
  1830. "Name": "Fresubin 2 kcal Fibre Drink",
  1831. "Description": "Lemon 4x200 ml EasyDrink",
  1832. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1833. "Payer_Condition": "Krankenkasse",
  1834. "Therapeutic_Plan": "TS",
  1835. "Quantity": 3,
  1836. "Stock": 10,
  1837. "Delivery_Date": "25.12.2016",
  1838. "Alternatives": [{
  1839. "id": "00003",
  1840. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
  1841. "Description": "Lemon 4x200 ml EasyDrink",
  1842. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1843. "Payer_Condition": "Krankenkasse",
  1844. "Therapeutic_Plan": "TS",
  1845. "Quantity": 3,
  1846. "Stock": 10,
  1847. "Delivery_Date": "30.12.2016"
  1848. }, {
  1849. "id": "00004",
  1850. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
  1851. "Description": "Lemon 4x200 ml EasyDrink",
  1852. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1853. "Payer_Condition": "Krankenkasse",
  1854. "Therapeutic_Plan": "TS",
  1855. "Quantity": 3,
  1856. "Stock": 10,
  1857. "Delivery_Date": "29.12.2016"
  1858. }]
  1859.  
  1860. }, {
  1861. "id": "00001",
  1862. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
  1863. "Description": "12x28 ml pack",
  1864. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  1865. "Payer_Condition": "Krankenkasse",
  1866. "Therapeutic_Plan": "TS",
  1867. "Quantity": 4,
  1868. "Stock": 15,
  1869. "Delivery_Date": "28.12.2016",
  1870. "Alternatives": [{
  1871. "id": "00005",
  1872. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
  1873. "Description": "12x28 ml pack",
  1874. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  1875. "Payer_Condition": "Krankenkasse",
  1876. "Therapeutic_Plan": "TS",
  1877. "Quantity": 3,
  1878. "Stock": 10,
  1879. "Delivery_Date": "27.12.2016"
  1880. }, {
  1881. "id": "0006",
  1882. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
  1883. "Description": "12x28 ml pack",
  1884. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  1885. "Payer_Condition": "Krankenkasse",
  1886. "Therapeutic_Plan": "TS",
  1887. "Quantity": 3,
  1888. "Stock": 10,
  1889. "Delivery_Date": "26.12.2016"
  1890. }]
  1891. }, {
  1892. "id": "00002",
  1893. "Name": "Mudan Fresan",
  1894. "Description": "Neutral 1x450g Dose",
  1895. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  1896. "Payer_Condition": "Krankenkasse",
  1897. "Therapeutic_Plan": "TS",
  1898. "Quantity": 4,
  1899. "Stock": 20,
  1900. "Delivery_Date": "25.12.2016",
  1901. "Alternatives": [{
  1902. "id": "00007",
  1903. "Name": "Mudan Fresan ALTERNATIVE 1",
  1904. "Description": "Neutral 1x450g Dose",
  1905. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  1906. "Payer_Condition": "Krankenkasse",
  1907. "Therapeutic_Plan": "TS",
  1908. "Quantity": 4,
  1909. "Stock": 20,
  1910. "Delivery_Date": "25.12.2016"
  1911. }]
  1912. }],
  1913. "Prescription_WV": [{
  1914.  
  1915. "id": "00000",
  1916. "Name": "Fresubin 2 kcal Fibre Drink",
  1917. "Description": "Lemon 4x200 ml EasyDrink",
  1918. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1919. "Payer_Condition": "Krankenkasse",
  1920. "Therapeutic_Plan": "WV",
  1921. "Quantity": 3,
  1922. "Stock": 10,
  1923. "Delivery_Date": "24.12.2016",
  1924. "Alternatives": [{
  1925. "id": "00003",
  1926. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
  1927. "Description": "Lemon 4x200 ml EasyDrink",
  1928. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1929. "Payer_Condition": "Krankenkasse",
  1930. "Therapeutic_Plan": "WV",
  1931. "Quantity": 3,
  1932. "Stock": 10,
  1933. "Delivery_Date": "23.12.2016"
  1934. }, {
  1935. "id": "00004",
  1936. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
  1937. "Description": "Lemon 4x200 ml EasyDrink",
  1938. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  1939. "Payer_Condition": "Krankenkasse",
  1940. "Therapeutic_Plan": "WV",
  1941. "Quantity": 3,
  1942. "Stock": 10,
  1943. "Delivery_Date": "23.12.2016"
  1944. }]
  1945.  
  1946. }, {
  1947. "id": "00001",
  1948. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
  1949. "Description": "12x28 ml pack",
  1950. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  1951. "Payer_Condition": "Krankenkasse",
  1952. "Therapeutic_Plan": "WV",
  1953. "Quantity": 4,
  1954. "Stock": 15,
  1955. "Delivery_Date": "25.12.2016",
  1956. "Alternatives": [{
  1957. "id": "00005",
  1958. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
  1959. "Description": "12x28 ml pack",
  1960. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  1961. "Payer_Condition": "Krankenkasse",
  1962. "Therapeutic_Plan": "WV",
  1963. "Quantity": 3,
  1964. "Stock": 10,
  1965. "Delivery_Date": "24.12.2016"
  1966. }, {
  1967. "id": "0006",
  1968. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
  1969. "Description": "12x28 ml pack",
  1970. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  1971. "Payer_Condition": "Krankenkasse",
  1972. "Therapeutic_Plan": "WV",
  1973. "Quantity": 3,
  1974. "Stock": 10,
  1975. "Delivery_Date": "23.12.2016"
  1976. }]
  1977. }, {
  1978. "id": "00002",
  1979. "Name": "Mudan Fresan",
  1980. "Description": "Neutral 1x450g Dose",
  1981. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  1982. "Payer_Condition": "Krankenkasse",
  1983. "Therapeutic_Plan": "WV",
  1984. "Quantity": 4,
  1985. "Stock": 20,
  1986. "Delivery_Date": "20.12.2016",
  1987. "Alternatives": [{
  1988. "id": "00007",
  1989. "Name": "Mudan Fresan ALTERNATIVE 1",
  1990. "Description": "Neutral 1x450g Dose",
  1991. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  1992. "Payer_Condition": "Krankenkasse",
  1993. "Therapeutic_Plan": "WV",
  1994. "Quantity": 4,
  1995. "Stock": 20,
  1996. "Delivery_Date": "25.12.2016"
  1997. }]
  1998. }]
  1999. }
  2000. }, {
  2001. "id": "2",
  2002. "Name": "Sandra",
  2003. "Last_Name": "Sielmann",
  2004. "Birth_Date": "15.08.1931",
  2005. "Last_Update": new Date("01/12/2016"),
  2006. "Gender": "F",
  2007. "Building": "Gebaude 2, Zimmer 255",
  2008. "Street": "Sunshinestrasse 125, 12855 Berlin",
  2009. "Delivery_Time": "Wunschlieferzeit 08:00AM-08:00PM",
  2010. "Image": "resources/common/assets/profile-circle.svg",
  2011. "DoctorName_TS": "Ann Stein",
  2012. "DoctorGender_TS": "M",
  2013. "DoctorName_EE": "Max Muller",
  2014. "DoctorGender_EE": "M",
  2015. "DoctorName_PE": "Carl Stein",
  2016. "DoctorGender_PE": "M",
  2017. "DoctorName_WV": "Rachel Muller",
  2018. "DoctorGender_WV": "F",
  2019. "therapeuticAreaTS": false,
  2020. "therapeuticAreaEE": false,
  2021. "therapeuticAreaPE": true,
  2022. "therapeuticAreaWV": false,
  2023. "Last_Prescription": {
  2024. "TS": false,
  2025. "EE": false,
  2026. "PE": true,
  2027. "WV": false,
  2028. "Non_Prescription": [],
  2029. "Prescription_PE": [{
  2030.  
  2031. "id": "00000",
  2032. "Name": "Fresubin 2 kcal Fibre Drink",
  2033. "Description": "Lemon 4x200 ml EasyDrink",
  2034. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2035. "Payer_Condition": "Krankenkasse",
  2036. "Therapeutic_Plan": "PE",
  2037. "Quantity": 3,
  2038. "Stock": 0,
  2039. "Delivery_Date": "25.11.2016",
  2040. "Alternatives": [{
  2041. "id": "00003",
  2042. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
  2043. "Description": "Lemon 4x200 ml EasyDrink",
  2044. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2045. "Payer_Condition": "Krankenkasse",
  2046. "Therapeutic_Plan": "PE",
  2047. "Quantity": 3,
  2048. "Stock": 10,
  2049. "Delivery_Date": "10.12.2016"
  2050. }, {
  2051. "id": "00004",
  2052. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
  2053. "Description": "Lemon 4x200 ml EasyDrink",
  2054. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2055. "Payer_Condition": "Krankenkasse",
  2056. "Therapeutic_Plan": "PE",
  2057. "Quantity": 3,
  2058. "Stock": 10,
  2059. "Delivery_Date": "01.12.2016"
  2060. }]
  2061.  
  2062. }, {
  2063. "id": "00001",
  2064. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
  2065. "Description": "12x28 ml pack",
  2066. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2067. "Payer_Condition": "Krankenkasse",
  2068. "Therapeutic_Plan": "PE",
  2069. "Quantity": 4,
  2070. "Stock": 15,
  2071. "Delivery_Date": "10.10.2016",
  2072. "Alternatives": [{
  2073. "id": "00005",
  2074. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
  2075. "Description": "12x28 ml pack",
  2076. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2077. "Payer_Condition": "Krankenkasse",
  2078. "Therapeutic_Plan": "PE",
  2079. "Quantity": 3,
  2080. "Stock": 10,
  2081. "Delivery_Date": "11.12.2016"
  2082. }, {
  2083. "id": "0006",
  2084. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
  2085. "Description": "12x28 ml pack",
  2086. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2087. "Payer_Condition": "Krankenkasse",
  2088. "Therapeutic_Plan": "PE",
  2089. "Quantity": 3,
  2090. "Stock": 10,
  2091. "Delivery_Date": "10.12.2016"
  2092. }]
  2093. }, {
  2094. "id": "00002",
  2095. "Name": "Mudan Fresan",
  2096. "Description": "Neutral 1x450g Dose",
  2097. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2098. "Payer_Condition": "Krankenkasse",
  2099. "Therapeutic_Plan": "PE",
  2100. "Quantity": 4,
  2101. "Stock": 20,
  2102. "Delivery_Date": "09.12.2016",
  2103. "Alternatives": [{
  2104. "id": "00007",
  2105. "Name": "Mudan Fresan ALTERNATIVE 1",
  2106. "Description": "Neutral 1x450g Dose",
  2107. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2108. "Payer_Condition": "Krankenkasse",
  2109. "Therapeutic_Plan": "PE",
  2110. "Quantity": 4,
  2111. "Stock": 20,
  2112. "Delivery_Date": "08.12.2016"
  2113. }]
  2114. }],
  2115. "Prescription_EE": [],
  2116. "Prescription_TS": [],
  2117. "Prescription_WV": []
  2118. },
  2119. "Therapy_Plan": {
  2120. "TS": true,
  2121. "EE": true,
  2122. "PE": false,
  2123. "WV": true,
  2124. "Non_Prescription": [{
  2125.  
  2126. "id": "00000",
  2127. "Name": "Fresubin 2 kcal Fibre Drink",
  2128. "Description": "Lemon 4x200 ml EasyDrink",
  2129. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2130. "Payer_Condition": "Selbstzahler",
  2131. "Therapeutic_Plan": "EE",
  2132. "Quantity": 3,
  2133. "Stock": 10,
  2134. "Delivery_Date": "25.12.2016",
  2135. "Alternatives": [{
  2136.  
  2137. "id": "00003",
  2138. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
  2139. "Description": "Lemon 4x200 ml EasyDrink",
  2140. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2141. "Payer_Condition": "Selbstzahler",
  2142. "Therapeutic_Plan": "EE",
  2143. "Quantity": 3,
  2144. "Stock": 10,
  2145. "Delivery_Date": "10.12.2016"
  2146.  
  2147. }, {
  2148.  
  2149. "id": "00004",
  2150. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
  2151. "Description": "Lemon 4x200 ml EasyDrink",
  2152. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2153. "Payer_Condition": "Selbstzahler",
  2154. "Therapeutic_Plan": "EE",
  2155. "Quantity": 3,
  2156. "Stock": 10,
  2157. "Delivery_Date": "11.12.2016"
  2158.  
  2159. }]
  2160.  
  2161. }, {
  2162. "id": "00001",
  2163. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
  2164. "Description": "12x28 ml pack",
  2165. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2166. "Payer_Condition": "Selbstzahler",
  2167. "Therapeutic_Plan": "TS",
  2168. "Quantity": 4,
  2169. "Stock": 15,
  2170. "Delivery_Date": "26.12.2016",
  2171. "Alternatives": [{
  2172. "id": "00005",
  2173. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack ALTERNATIVE 1",
  2174. "Description": "12x28 ml pack",
  2175. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2176. "Payer_Condition": "Selbstzahler",
  2177. "Therapeutic_Plan": "TS",
  2178. "Quantity": 4,
  2179. "Stock": 15,
  2180. "Delivery_Date": "24.12.2016"
  2181. }]
  2182. }, {
  2183. "id": "00002",
  2184. "Name": "Mudan Fresan",
  2185. "Description": "Neutral 1x450g Dose",
  2186. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2187. "Payer_Condition": "Selbstzahler",
  2188. "Therapeutic_Plan": "EE",
  2189. "Quantity": 4,
  2190. "Stock": 20,
  2191. "Delivery_Date": "23.12.2016",
  2192. "Alternatives": [{
  2193. "id": "00007",
  2194. "Name": "Mudan Fresan ALTERNATIVE 1",
  2195. "Description": "Neutral 1x450g Dose",
  2196. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2197. "Payer_Condition": "Selbstzahler",
  2198. "Therapeutic_Plan": "EE",
  2199. "Quantity": 4,
  2200. "Stock": 15,
  2201. "Delivery_Date": "22.12.2016"
  2202. }]
  2203. }],
  2204. "Prescription_EE": [],
  2205. "Prescription_PE": [],
  2206. "Prescription_TS": [{
  2207.  
  2208. "id": "00000",
  2209. "Name": "Fresubin 2 kcal Fibre Drink",
  2210. "Description": "Lemon 4x200 ml EasyDrink",
  2211. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2212. "Payer_Condition": "Krankenkasse",
  2213. "Therapeutic_Plan": "TS",
  2214. "Quantity": 3,
  2215. "Stock": 10,
  2216. "Delivery_Date": "25.12.2016",
  2217. "Alternatives": [{
  2218. "id": "00003",
  2219. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
  2220. "Description": "Lemon 4x200 ml EasyDrink",
  2221. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2222. "Payer_Condition": "Krankenkasse",
  2223. "Therapeutic_Plan": "TS",
  2224. "Quantity": 3,
  2225. "Stock": 10,
  2226. "Delivery_Date": "30.12.2016"
  2227. }, {
  2228. "id": "00004",
  2229. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
  2230. "Description": "Lemon 4x200 ml EasyDrink",
  2231. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2232. "Payer_Condition": "Krankenkasse",
  2233. "Therapeutic_Plan": "TS",
  2234. "Quantity": 3,
  2235. "Stock": 10,
  2236. "Delivery_Date": "29.12.2016"
  2237. }]
  2238.  
  2239. }, {
  2240. "id": "00001",
  2241. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
  2242. "Description": "12x28 ml pack",
  2243. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2244. "Payer_Condition": "Krankenkasse",
  2245. "Therapeutic_Plan": "TS",
  2246. "Quantity": 4,
  2247. "Stock": 15,
  2248. "Delivery_Date": "28.12.2016",
  2249. "Alternatives": [{
  2250. "id": "00005",
  2251. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
  2252. "Description": "12x28 ml pack",
  2253. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2254. "Payer_Condition": "Krankenkasse",
  2255. "Therapeutic_Plan": "TS",
  2256. "Quantity": 3,
  2257. "Stock": 10,
  2258. "Delivery_Date": "27.12.2016"
  2259. }, {
  2260. "id": "0006",
  2261. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
  2262. "Description": "12x28 ml pack",
  2263. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2264. "Payer_Condition": "Krankenkasse",
  2265. "Therapeutic_Plan": "TS",
  2266. "Quantity": 3,
  2267. "Stock": 10,
  2268. "Delivery_Date": "26.12.2016"
  2269. }]
  2270. }, {
  2271. "id": "00002",
  2272. "Name": "Mudan Fresan",
  2273. "Description": "Neutral 1x450g Dose",
  2274. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2275. "Payer_Condition": "Krankenkasse",
  2276. "Therapeutic_Plan": "TS",
  2277. "Quantity": 4,
  2278. "Stock": 20,
  2279. "Delivery_Date": "25.12.2016",
  2280. "Alternatives": [{
  2281. "id": "00007",
  2282. "Name": "Mudan Fresan ALTERNATIVE 1",
  2283. "Description": "Neutral 1x450g Dose",
  2284. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2285. "Payer_Condition": "Krankenkasse",
  2286. "Therapeutic_Plan": "TS",
  2287. "Quantity": 4,
  2288. "Stock": 20,
  2289. "Delivery_Date": "25.12.2016"
  2290. }]
  2291. }],
  2292. "Prescription_WV": [{
  2293.  
  2294. "id": "00000",
  2295. "Name": "Fresubin 2 kcal Fibre Drink",
  2296. "Description": "Lemon 4x200 ml EasyDrink",
  2297. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2298. "Payer_Condition": "Krankenkasse",
  2299. "Therapeutic_Plan": "WV",
  2300. "Quantity": 3,
  2301. "Stock": 10,
  2302. "Delivery_Date": "24.12.2016",
  2303. "Alternatives": [{
  2304. "id": "00003",
  2305. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
  2306. "Description": "Lemon 4x200 ml EasyDrink",
  2307. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2308. "Payer_Condition": "Krankenkasse",
  2309. "Therapeutic_Plan": "WV",
  2310. "Quantity": 3,
  2311. "Stock": 10,
  2312. "Delivery_Date": "23.12.2016"
  2313. }, {
  2314. "id": "00004",
  2315. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
  2316. "Description": "Lemon 4x200 ml EasyDrink",
  2317. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2318. "Payer_Condition": "Krankenkasse",
  2319. "Therapeutic_Plan": "WV",
  2320. "Quantity": 3,
  2321. "Stock": 10,
  2322. "Delivery_Date": "23.12.2016"
  2323. }]
  2324.  
  2325. }, {
  2326. "id": "00001",
  2327. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
  2328. "Description": "12x28 ml pack",
  2329. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2330. "Payer_Condition": "Krankenkasse",
  2331. "Therapeutic_Plan": "WV",
  2332. "Quantity": 4,
  2333. "Stock": 15,
  2334. "Delivery_Date": "25.12.2016",
  2335. "Alternatives": [{
  2336. "id": "00005",
  2337. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
  2338. "Description": "12x28 ml pack",
  2339. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2340. "Payer_Condition": "Krankenkasse",
  2341. "Therapeutic_Plan": "WV",
  2342. "Quantity": 3,
  2343. "Stock": 10,
  2344. "Delivery_Date": "24.12.2016"
  2345. }, {
  2346. "id": "0006",
  2347. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
  2348. "Description": "12x28 ml pack",
  2349. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2350. "Payer_Condition": "Krankenkasse",
  2351. "Therapeutic_Plan": "WV",
  2352. "Quantity": 3,
  2353. "Stock": 10,
  2354. "Delivery_Date": "23.12.2016"
  2355. }]
  2356. }, {
  2357. "id": "00002",
  2358. "Name": "Mudan Fresan",
  2359. "Description": "Neutral 1x450g Dose",
  2360. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2361. "Payer_Condition": "Krankenkasse",
  2362. "Therapeutic_Plan": "WV",
  2363. "Quantity": 4,
  2364. "Stock": 20,
  2365. "Delivery_Date": "20.12.2016",
  2366. "Alternatives": [{
  2367. "id": "00007",
  2368. "Name": "Mudan Fresan ALTERNATIVE 1",
  2369. "Description": "Neutral 1x450g Dose",
  2370. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2371. "Payer_Condition": "Krankenkasse",
  2372. "Therapeutic_Plan": "WV",
  2373. "Quantity": 4,
  2374. "Stock": 20,
  2375. "Delivery_Date": "25.12.2016"
  2376. }]
  2377. }]
  2378. }
  2379. }, {
  2380. "id": "3",
  2381. "Name": "Ana",
  2382. "Last_Name": "João",
  2383. "Birth_Date": "15.02.1991",
  2384. "Last_Update": new Date("01/12/2016"),
  2385. "Gender": "F",
  2386. "Building": "Gebaude 2, Zimmer 255",
  2387. "Street": "Sunshinestrasse 125, 12855 Berlin",
  2388. "Delivery_Time": "Wunschlieferzeit 08:00AM-08:00PM",
  2389. "Image": "resources/common/assets/profile-circle.svg",
  2390. "DoctorName_TS": "Ann Stein",
  2391. "DoctorGender_TS": "M",
  2392. "DoctorName_EE": "Max Muller",
  2393. "DoctorGender_EE": "M",
  2394. "DoctorName_PE": "Carl Stein",
  2395. "DoctorGender_PE": "M",
  2396. "DoctorName_WV": "Rachel Muller",
  2397. "DoctorGender_WV": "F",
  2398. "Last_Prescription": "No",
  2399. "therapeuticAreaTS": false,
  2400. "therapeuticAreaEE": false,
  2401. "therapeuticAreaPE": true,
  2402. "therapeuticAreaWV": false,
  2403. "Therapy_Plan": {
  2404. "TS": false,
  2405. "EE": false,
  2406. "PE": true,
  2407. "WV": false,
  2408. "Non_Prescription": [],
  2409. "Prescription_PE": [{
  2410.  
  2411. "id": "00000",
  2412. "Name": "Fresubin 2 kcal Fibre Drink",
  2413. "Description": "Lemon 4x200 ml EasyDrink",
  2414. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2415. "Payer_Condition": "Krankenkasse",
  2416. "Therapeutic_Plan": "PE",
  2417. "Quantity": 3,
  2418. "Stock": 10,
  2419. "Delivery_Date": "25.12.2016",
  2420. "Alternatives": [{
  2421. "id": "00003",
  2422. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 1",
  2423. "Description": "Lemon 4x200 ml EasyDrink",
  2424. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2425. "Payer_Condition": "Krankenkasse",
  2426. "Therapeutic_Plan": "PE",
  2427. "Quantity": 3,
  2428. "Stock": 10,
  2429. "Delivery_Date": "10.12.2016"
  2430. }, {
  2431. "id": "00004",
  2432. "Name": "Fresubin 2 kcal Fibre Drink ALTERNATIVE 2",
  2433. "Description": "Lemon 4x200 ml EasyDrink",
  2434. "Image": "https://apomedia.mauve.eu/500x500/06964667.jpg",
  2435. "Payer_Condition": "Krankenkasse",
  2436. "Therapeutic_Plan": "PE",
  2437. "Quantity": 3,
  2438. "Stock": 10,
  2439. "Delivery_Date": "20.12.2016"
  2440. }]
  2441.  
  2442. }, {
  2443. "id": "00001",
  2444. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack",
  2445. "Description": "12x28 ml pack",
  2446. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2447. "Payer_Condition": "Krankenkasse",
  2448. "Therapeutic_Plan": "PE",
  2449. "Quantity": 4,
  2450. "Stock": 15,
  2451. "Delivery_Date": "10.12.2016",
  2452. "Alternatives": [{
  2453. "id": "00005",
  2454. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 1",
  2455. "Description": "12x28 ml pack",
  2456. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2457. "Payer_Condition": "Krankenkasse",
  2458. "Therapeutic_Plan": "PE",
  2459. "Quantity": 3,
  2460. "Stock": 10,
  2461. "Delivery_Date": "11.12.2016"
  2462. }, {
  2463. "id": "0006",
  2464. "Name": "FORTIMEL Compact 2.4 Cappuccinogeschmack Alternative 2",
  2465. "Description": "12x28 ml pack",
  2466. "Image": " http://cdn.idealo.com/folder/Product/2896/1/2896128/s1_produktbild_mid/nutricia-fortimel-compact-cappuccinogeschmack-8-x-4-x-125-ml.jpg",
  2467. "Payer_Condition": "Krankenkasse",
  2468. "Therapeutic_Plan": "PE",
  2469. "Quantity": 3,
  2470. "Stock": 10,
  2471. "Delivery_Date": "10.12.2016"
  2472. }]
  2473. }, {
  2474. "id": "00002",
  2475. "Name": "Mudan Fresan",
  2476. "Description": "Neutral 1x450g Dose",
  2477. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2478. "Payer_Condition": "Krankenkasse",
  2479. "Therapeutic_Plan": "PE",
  2480. "Quantity": 4,
  2481. "Stock": 3,
  2482. "Delivery_Date": "09.12.2016",
  2483. "Alternatives": [{
  2484. "id": "00007",
  2485. "Name": "Mudan Fresan ALTERNATIVE 1",
  2486. "Description": "Neutral 1x450g Dose",
  2487. "Image": "https://images.medpex.de/medias/HdYIzKLNVhV27DeVnFIVka-30.jpg",
  2488. "Payer_Condition": "Krankenkasse",
  2489. "Therapeutic_Plan": "PE",
  2490. "Quantity": 4,
  2491. "Stock": 20,
  2492. "Delivery_Date": "08.12.2016"
  2493. }]
  2494. }],
  2495. "Prescription_EE": [],
  2496. "Prescription_TS": [],
  2497. "Prescription_WV": []
  2498. }
  2499. }, {
  2500. "id": "4",
  2501. "Name": "Max",
  2502. "Last_Name": "Müller",
  2503. "Birth_Date": "",
  2504. "Last_Update": new Date("01/12/2016"),
  2505. "Gender": "M",
  2506. "Building": "",
  2507. "Street": "",
  2508. "Delivery_Time": "Wunschlieferzeit 08:00AM-08:00PM",
  2509. "Image": "resources/common/assets/profile-circle.svg",
  2510. "DoctorName_TS": "Ann Stein",
  2511. "DoctorGender_TS": "M",
  2512. "DoctorName_EE": "Max Muller",
  2513. "DoctorGender_EE": "M",
  2514. "DoctorName_PE": "Carl Stein",
  2515. "DoctorGender_PE": "M",
  2516. "DoctorName_WV": "Rachel Muller",
  2517. "DoctorGender_WV": "F",
  2518. "Last_Prescription": "No",
  2519. "therapeuticAreaTS": false,
  2520. "therapeuticAreaEE": false,
  2521. "therapeuticAreaPE": false,
  2522. "therapeuticAreaWV": false,
  2523. "Therapy_Plan": "No"
  2524. }]
  2525. };
  2526.  
  2527. var oModel = new sap.ui.model.json.JSONModel(oData);
  2528. sap.ui.getCore().setModel(oModel, "PATIENTMODEL");
  2529. },
  2530.  
  2531. /**
  2532. * Function that receives integers year, month and day and converts them
  2533. * and returns concatenated string date with values year , month and day
  2534. *
  2535. * @author
  2536. */
  2537. dateAsString: function(iYear, iMonth, iDay) {
  2538. var sDateString;
  2539. if (iDay < 10 && iMonth >= 10) {
  2540. sDateString = iYear.toString() + iMonth.toString() + "0" + iDay.toString();
  2541. } else if (iMonth < 10 && iDay >= 10) {
  2542. sDateString = iYear.toString() + "0" + iMonth.toString() + iDay.toString();
  2543. } else if (iMonth < 10 && iDay < 10) {
  2544. sDateString = iYear.toString() + "0" + iMonth.toString() + "0" + iDay.toString();
  2545. } else {
  2546. sDateString = iYear.toString() + iMonth.toString() + iDay.toString();
  2547. }
  2548. return sDateString;
  2549. },
  2550.  
  2551. /**
  2552. * Function that receives string param and
  2553. * returns the age corresponding
  2554. *
  2555. * @author
  2556. */
  2557. getAge: function(sParam) {
  2558. var oTodayDate = new Date();
  2559. var iTodayMonth = oTodayDate.getMonth();
  2560. var iTodayYear = oTodayDate.getFullYear();
  2561. var iTodayDay = oTodayDate.getDate();
  2562.  
  2563. var sStringbirthYear = sParam.substring(6, 10);
  2564. var iBirthYear = parseInt(sStringbirthYear, 10);
  2565.  
  2566. var sStringbirthMonth = sParam.substring(3, 5);
  2567. var iBirthMonth = parseInt(sStringbirthMonth, 10);
  2568.  
  2569. var sStringbirthDay = sParam.substring(0, 2);
  2570. var iBirthYear = parseInt(sStringbirthDay, 10);
  2571.  
  2572. var iAgePatient = iTodayYear - iBirthYear;
  2573. if (iTodayMonth < (iBirthYear - 1)) {
  2574. iAgePatient--;
  2575. }
  2576. if (((iBirthYear - 1) === iTodayMonth) && (iTodayDay < iBirthDay)) {
  2577. iAgePatient--;
  2578. }
  2579. return iAgePatient;
  2580. },
  2581.  
  2582. /**
  2583. * Function that load model of property AcceptedPatients case exists,
  2584. * else it just initiate with empty data
  2585. *
  2586. * @author
  2587. */
  2588. loadAcceptedPatients: function() {
  2589. var oModel = sap.ui.getCore().getModel();
  2590. var oData = [];
  2591. if (!oModel.getProperty("/acceptedPatients")) {
  2592. oModel.setProperty("/acceptedPatients", oData);
  2593. }
  2594.  
  2595. },
  2596.  
  2597. /**
  2598. * Function that receives string street, city, telephone, fax and email and
  2599. * returns true if none is empty, or false if at least one is empty
  2600. *
  2601. * @author
  2602. */
  2603. getVisibilityGeneralData: function(sStreet, sCity, sTel, sFax, sEmail) {
  2604. if (!sStreet || !sCity || !sTel || !sFax || !sEmail) {
  2605. return false;
  2606. } else if (sStreet.length > 0 || sCity.length > 0 || sTel.length > 0 || sFax.length > 0 || sEmail.length > 0) {
  2607. return true;
  2608. } else {
  2609. return false;
  2610. }
  2611. },
  2612.  
  2613. /**
  2614. * Function that receives string street, city, telephone, fax and email and
  2615. * returns true if all are empty, or false if at least one is not empty
  2616. *
  2617. * @author
  2618. */
  2619. getVisibilityUnknownGeneral: function(sStreet, sCity, sTel, sFax, sEmail) {
  2620. if (!sStreet || !sCity || !sTel || !sFax || !sEmail) {
  2621. return true;
  2622. } else if (sStreet.length > 0 || sCity.length > 0 || sTel.length > 0 || sFax.length > 0 || sEmail.length > 0) {
  2623. return false;
  2624. } else {
  2625. return true;
  2626. }
  2627. },
  2628.  
  2629. /**
  2630. * Function that receives object input, city, and returns
  2631. * X in case variable is true, "" in case variable is false,
  2632. * true in case variable is X and false in case variable is ""
  2633. *
  2634. * @author
  2635. */
  2636. XToTrueAndTrueToX: function(oInput) {
  2637. switch (oInput) {
  2638. case true:
  2639. return "X";
  2640. case false:
  2641. return "";
  2642. case "X":
  2643. return true;
  2644. case "":
  2645. return false;
  2646. default:
  2647. break;
  2648. }
  2649. },
  2650.  
  2651. /**
  2652. * Function that receives integer input and
  2653. * return true in case variable is equal to 0 or 1, and false otherwise
  2654. *
  2655. * @author
  2656. */
  2657. getSelectedCheckBox: function(iInput) {
  2658. if (iInput === 0 || iInput === 1) {
  2659. return true;
  2660. } else {
  2661. return false;
  2662. }
  2663. },
  2664.  
  2665. /**
  2666. * Function that load model of property Institutions
  2667. * according to the data build in the function
  2668. *
  2669. * @author
  2670. */
  2671. loadInstitutionsData: function() {
  2672. var aInstData = [{
  2673. name: "Bunter Strauß",
  2674. street: "Straußmannstr.",
  2675. additionalStreet: "168",
  2676. zipCode: "12047",
  2677. city: "Berlin-Neukolln",
  2678. tel: "030 85858585",
  2679. fax: "030 85858585",
  2680. email: "kontakt@bunterstrausspflegeheim.de"
  2681. }, {
  2682. name: "Institution2",
  2683. street: "Street2",
  2684. additionalStreet: "002",
  2685. zipCode: "00002",
  2686. city: "City2",
  2687. tel: "030 00000003",
  2688. fax: "030 00000004",
  2689. email: "email2@gmx.de"
  2690. }];
  2691.  
  2692. var oModel = this.getView().getModel();
  2693. oModel.setProperty("/institutions", aInstData);
  2694. },
  2695.  
  2696. /**
  2697. * Function that receives a string key and load model of property Institutions
  2698. * according to the data build in the different varible key cases
  2699. *
  2700. * @author
  2701. */
  2702. loadnameDischargingInsitution: function(sKey) {
  2703. var aDischargeInstitutionData;
  2704. switch (sKey) {
  2705. case "Krankenhaus":
  2706. aDischargeInstitutionData = [{
  2707. "name": "KH Vivantes Berlin-Neuköllnd",
  2708. "street": "Straußmannstr. 168",
  2709. "additionalStreet": "LOL",
  2710. "zipCode": "12047",
  2711. "city": "Berlin-Neukölln",
  2712. "tel": "030 85858585",
  2713. "fax": "030 85858588",
  2714. "email": "kontakt@vivantes.de"
  2715. }, {
  2716. "name": "Kwqeqwellnd",
  2717. "street": "Straußmannstr. 168",
  2718. "additionalStreet": "LOL",
  2719. "zipCode": "1eqwe7",
  2720. "city": "qweln",
  2721. "tel": "029328585",
  2722. "fax": "12312123128",
  2723. "email": "kontakt@vivantes.de"
  2724. }];
  2725. break;
  2726. case "Händler":
  2727. aDischargeInstitutionData = [{
  2728. "name": "OLa",
  2729. "street": "Straußmannstr. 168",
  2730. "additionalStreet": "LOL",
  2731. "zipCode": "1eqwe7",
  2732. "city": "qweln",
  2733. "tel": "029328585",
  2734. "fax": "12312123128",
  2735. "email": "kontakt@vivantes.de"
  2736. }, {
  2737. "name": "Mundo",
  2738. "street": "Straußmannstr. 168",
  2739. "additionalStreet": "LOL",
  2740. "zipCode": "1eqwe7",
  2741. "city": "qweln",
  2742. "tel": "029328585",
  2743. "fax": "12312123128",
  2744. "email": "kontakt@vivantes.de"
  2745. }];
  2746. break;
  2747. case "Kostenträger":
  2748. aDischargeInstitutionData = [{
  2749. "name": "Kostenträger",
  2750. "street": "Straußmannstr. 168",
  2751. "additionalStreet": "LOL",
  2752. "zipCode": "1eqwe7",
  2753. "city": "qweln",
  2754. "tel": "029328585",
  2755. "fax": "12312123128",
  2756. "email": "kontakt@vivantes.de"
  2757. }, {
  2758. "name": "Kostenträger",
  2759. "street": "Straußmannstr. 168",
  2760. "additionalStreet": "LOL",
  2761. "zipCode": "1eqwe7",
  2762. "city": "qweln",
  2763. "tel": "029328585",
  2764. "fax": "12312123128",
  2765. "email": "kontakt@vivantes.de"
  2766. }];
  2767. break;
  2768. case "Praxis":
  2769. aDischargeInstitutionData = [{
  2770. "name": "Praxis",
  2771. "street": "Straußmannstr. 168",
  2772. "additionalStreet": "LOL",
  2773. "zipCode": "1eqwe7",
  2774. "city": "qweln",
  2775. "tel": "029328585",
  2776. "fax": "12312123128",
  2777. "email": "kontakt@vivantes.de"
  2778. }, {
  2779. "name": "Praxis2",
  2780. "street": "Straußmannstr. 168",
  2781. "additionalStreet": "LOL",
  2782. "zipCode": "1eqwe7",
  2783. "city": "qweln",
  2784. "tel": "029328585",
  2785. "fax": "12312123128",
  2786. "email": "kontakt@vivantes.de"
  2787. }];
  2788. break;
  2789. case "Pflegedienst":
  2790. aDischargeInstitutionData = [{
  2791. "name": "Pflegedienst",
  2792. "street": "Straußmannstr. 168",
  2793. "additionalStreet": "LOL",
  2794. "zipCode": "1eqwe7",
  2795. "city": "qweln",
  2796. "tel": "029328585",
  2797. "fax": "12312123128",
  2798. "email": "kontakt@vivantes.de"
  2799. }];
  2800. break;
  2801. case "Pflegeeinrichtung":
  2802. aDischargeInstitutionData = [{
  2803. "name": "Pflegeeinrichtung",
  2804. "street": "Straußmannstr. 168",
  2805. "additionalStreet": "LOL",
  2806. "zipCode": "1eqwe7",
  2807. "city": "qweln",
  2808. "tel": "029328585",
  2809. "fax": "12312123128",
  2810. "email": "kontakt@vivantes.de"
  2811. }];
  2812. break;
  2813. case "Apotheke":
  2814. aDischargeInstitutionData = [{
  2815. "name": "Apotheke",
  2816. "street": "Straußmannstr. 168",
  2817. "additionalStreet": "LOL",
  2818. "zipCode": "1eqwe7",
  2819. "city": "qweln",
  2820. "tel": "029328585",
  2821. "fax": "12312123128",
  2822. "email": "kontakt@vivantes.de"
  2823. }];
  2824. break;
  2825. case "Netzwerkpartner":
  2826. aDischargeInstitutionData = [{
  2827. "name": "Netzwerkpartner",
  2828. "street": "Straußmannstr. 168",
  2829. "additionalStreet": "LOL",
  2830. "zipCode": "1eqwe7",
  2831. "city": "qweln",
  2832. "tel": "029328585",
  2833. "fax": "12312123128",
  2834. "email": "kontakt@vivantes.de"
  2835. }];
  2836. break;
  2837. }
  2838.  
  2839. var oModel = this.getView().getModel();
  2840. oModel.setProperty("/institutions", aDischargeInstitutionData);
  2841. oModel.refresh();
  2842. },
  2843.  
  2844. /**
  2845. * In this function, we will validate the string fields.
  2846. *
  2847. * @author Francisco Onieva
  2848. */
  2849. validateStringField: function(str) {
  2850. var rValidRegEx = /^[^\\\/&]+$/;
  2851. return rValidRegEx.test(str);
  2852. },
  2853.  
  2854. /**
  2855. * In this function, we will validate the datetime fields.
  2856. *
  2857. * @author Francisco Onieva
  2858. */
  2859. validateDateField: function(date) {
  2860. /*var rValidRegEx = /^\d{1,2}\.\d{1,2}\.\d{4}$/;
  2861. return rValidRegEx.test(date);*/
  2862. if(date){
  2863. if (date.getDate && date.getMonth && date.getYear) {
  2864. return true;
  2865. } else {
  2866. return false;
  2867. }
  2868. } else {
  2869. return false;
  2870. }
  2871.  
  2872. },
  2873.  
  2874. /**
  2875. * In this function, we will validate the number fields.
  2876. *
  2877. * @author Francisco Onieva
  2878. */
  2879. validateNumberField: function(number) {
  2880. var rValidRegEx = /^(\+)*[0-9 ]+$/;
  2881. return rValidRegEx.test(number);
  2882. },
  2883.  
  2884. /**
  2885. * In this function, we will validate the float fields.
  2886. *
  2887. * @author Tiago Martins
  2888. */
  2889. validateFloatField: function(number) {
  2890. var rValidRegEx = /^[0-9]+(\.|,)?([0-9]+)?$/;
  2891. return rValidRegEx.test(number);
  2892. },
  2893.  
  2894. /**
  2895. * In this function, we will validate the email fields.
  2896. *
  2897. * @author José Graça
  2898. */
  2899. validateEmailField: function(email) {
  2900. var validRegEx = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/;
  2901. return validRegEx.test(email);
  2902. },
  2903.  
  2904. /**
  2905. * In this function, we will validate the hours fields.
  2906. *
  2907. * @author José Graça
  2908. */
  2909. validateHoursField: function(hour) {
  2910. var validRegEx = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/;
  2911. return validRegEx.test(hour);
  2912. },
  2913.  
  2914. /**
  2915. * Parse the Json date received and return the date
  2916. *
  2917. * @author Francisco Onieva
  2918. */
  2919. parseJsonDate: function(dJsonDate) {
  2920. var dOffset = new Date().getTimezoneOffset();
  2921. var aParts = /\/Date\((-?\d+)([+-]\d{2})?(\d{2})?.*/.exec(dJsonDate);
  2922.  
  2923. if (aParts[2] == undefined) {
  2924. aParts[2] = 0;
  2925. }
  2926.  
  2927. if (aParts[3] == undefined) {
  2928. aParts[3] = 0;
  2929. }
  2930.  
  2931. return new Date(+aParts[1] + dOffset + aParts[2] * 3600000 + aParts[3] * 60000);
  2932. },
  2933.  
  2934. /**
  2935. * This function puts the field update when the string field is filled
  2936. *
  2937. * @author José Graça
  2938. */
  2939. setFieldUpdatedFlagForString: function(oEvent) {
  2940. var oElement = oEvent.getSource();
  2941. var sPathValue = oElement.getBindingPath("value");
  2942. var aPathValue = sPathValue.split("/");
  2943. aPathValue.pop();
  2944. var aPathContext;
  2945.  
  2946. if (oElement.getBindingContext()) {
  2947. aPathContext = oElement.getBindingContext().getPath().split("/");
  2948. } else {
  2949. aPathContext = [];
  2950. }
  2951.  
  2952. var bEqualsTo = false;
  2953.  
  2954. for (var i in aPathValue) {
  2955. bEqualsTo = false;
  2956. for (var j in aPathContext) {
  2957. if (aPathContext[j] === aPathValue[i]) {
  2958. bEqualsTo = true;
  2959. break;
  2960. }
  2961. }
  2962. if (bEqualsTo === false) {
  2963. aPathContext.push(aPathValue[i]);
  2964. }
  2965. }
  2966.  
  2967. var sPathUpdated = aPathContext.join("/") + "/updated";
  2968. var sValue = oEvent.getSource().getValue();
  2969.  
  2970. if (this.validateStringField(sValue)) {
  2971. this.getView().getModel().setProperty(sPathUpdated, true);
  2972. } else {
  2973. if (sValue === "") {
  2974. this.getView().getModel().setProperty(sPathUpdated, true);
  2975. } else {
  2976. this.getView().getModel().setProperty(sPathUpdated, false);
  2977. }
  2978. }
  2979.  
  2980. //Force refreshModel
  2981. sPathValue = aPathContext.join("/") + "/value";
  2982. this.getView().getModel().setProperty(sPathValue, sValue);
  2983.  
  2984. //If the user is in the Patient Master Data, change text color to green
  2985. if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
  2986. this.getView().getModel().getProperty(sPathUpdated) &&
  2987. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  2988. oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
  2989. oEvent.getSource().addStyleClass("fs_ws_positive_color");
  2990. }
  2991. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  2992. oEvent.getSource().removeStyleClass("fs_ws_positive_color");
  2993. oEvent.getSource().addStyleClass("fs_ws_gray1_color");
  2994. }
  2995.  
  2996. //Change the checkSubmit field in order to trigger the getEnabledButton
  2997. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  2998.  
  2999.  
  3000. },
  3001.  
  3002. /**
  3003. * This function puts the field update when the number field is filled
  3004. *
  3005. * @author José Graça
  3006. */
  3007. setFieldUpdatedFlagForNumber: function(oEvent) {
  3008. var oElement = oEvent.getSource();
  3009. var sPathValue = oElement.getBindingPath("value");
  3010. var aPathValue = sPathValue.split("/");
  3011. aPathValue.pop();
  3012. var aPathContext;
  3013.  
  3014. if (oElement.getBindingContext()) {
  3015. aPathContext = oElement.getBindingContext().getPath().split("/");
  3016. } else {
  3017. aPathContext = [];
  3018. }
  3019.  
  3020. var bEqualsTo = false;
  3021.  
  3022. for (var i in aPathValue) {
  3023. bEqualsTo = false;
  3024. for (var j in aPathContext) {
  3025. if (aPathContext[j] === aPathValue[i]) {
  3026. bEqualsTo = true;
  3027. break;
  3028. }
  3029. }
  3030. if (bEqualsTo === false) {
  3031. aPathContext.push(aPathValue[i]);
  3032. }
  3033. }
  3034.  
  3035. var sPathUpdated = aPathContext.join("/") + "/updated";
  3036. var sValue = oEvent.getParameter("value");
  3037.  
  3038. if (this.validateNumberField(sValue)) {
  3039. this.getView().getModel().setProperty(sPathUpdated, true);
  3040. } else {
  3041. this.getView().getModel().setProperty(sPathUpdated, false);
  3042. }
  3043.  
  3044. //Force refreshModel
  3045. sPathValue = aPathContext.join("/") + "/value";
  3046. this.getView().getModel().setProperty(sPathValue, sValue);
  3047.  
  3048. //If the user is in the Patient Master Data, change text color to green
  3049. if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
  3050. this.getView().getModel().getProperty(sPathUpdated) &&
  3051. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  3052. if(oEvent.getId() === "change"){
  3053. oEvent.getSource().removeStyleClass("fs_ws_freseniusblue_slider");
  3054. oEvent.getSource().addStyleClass("fs_ws_positive_slider");
  3055. }
  3056. else{
  3057. oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
  3058. oEvent.getSource().addStyleClass("fs_ws_positive_color");
  3059. }
  3060. }
  3061. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  3062. if(oEvent.getId() === "change"){
  3063. oEvent.getSource().removeStyleClass("fs_ws_positive_slider");
  3064. oEvent.getSource().addStyleClass("fs_ws_freseniusblue_slider");
  3065. }
  3066. else{
  3067. oEvent.getSource().removeStyleClass("fs_ws_positive_color");
  3068. oEvent.getSource().addStyleClass("fs_ws_gray1_color");
  3069. }
  3070. }
  3071.  
  3072. //Change the checkSubmit field in order to trigger the getEnabledButton
  3073. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  3074.  
  3075.  
  3076. },
  3077.  
  3078. /**
  3079. * This function puts the field update when the float field is filled
  3080. *
  3081. * @author José Graça
  3082. */
  3083. setFieldUpdatedFlagForFloat: function(oEvent) {
  3084. var oElement = oEvent.getSource();
  3085. var sPathValue = oElement.getBindingPath("value");
  3086. var aPathValue = sPathValue.split("/");
  3087. aPathValue.pop();
  3088. var aPathContext;
  3089.  
  3090. if (oElement.getBindingContext()) {
  3091. aPathContext = oElement.getBindingContext().getPath().split("/");
  3092. } else {
  3093. aPathContext = [];
  3094. }
  3095.  
  3096. var bEqualsTo = false;
  3097.  
  3098. for (var i in aPathValue) {
  3099. bEqualsTo = false;
  3100. for (var j in aPathContext) {
  3101. if (aPathContext[j] === aPathValue[i]) {
  3102. bEqualsTo = true;
  3103. break;
  3104. }
  3105. }
  3106. if (bEqualsTo === false) {
  3107. aPathContext.push(aPathValue[i]);
  3108. }
  3109. }
  3110.  
  3111. var sPathUpdated = aPathContext.join("/") + "/updated";
  3112. var sValue = oEvent.getParameter("value");
  3113.  
  3114. if (this.validateFloatField(sValue)) {
  3115. this.getView().getModel().setProperty(sPathUpdated, true);
  3116. } else {
  3117. this.getView().getModel().setProperty(sPathUpdated, false);
  3118. }
  3119.  
  3120. //Force refreshModel
  3121. sPathValue = aPathContext.join("/") + "/value";
  3122. this.getView().getModel().setProperty(sPathValue, sValue);
  3123.  
  3124. //If the user is in the Patient Master Data, change text color to green
  3125. if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
  3126. this.getView().getModel().getProperty(sPathUpdated) &&
  3127. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  3128. oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
  3129. oEvent.getSource().addStyleClass("fs_ws_positive_color");
  3130. }
  3131. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  3132. oEvent.getSource().removeStyleClass("fs_ws_positive_color");
  3133. oEvent.getSource().addStyleClass("fs_ws_gray1_color");
  3134. }
  3135.  
  3136. //Change the checkSubmit field in order to trigger the getEnabledButton
  3137. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  3138.  
  3139.  
  3140. },
  3141.  
  3142. /**
  3143. * This function puts the field update when the date field is filled
  3144. *
  3145. * @author José Graça
  3146. */
  3147. setFieldUpdatedFlagForDate: function(oEvent) {
  3148. var oElement = oEvent.getSource();
  3149. var sPathValue = oElement.getBindingPath("dateValue");
  3150. var aPathValue = sPathValue.split("/");
  3151. aPathValue.pop();
  3152. var aPathContext;
  3153.  
  3154. if (oElement.getBindingContext()) {
  3155. aPathContext = oElement.getBindingContext().getPath().split("/");
  3156. } else {
  3157. aPathContext = [];
  3158. }
  3159.  
  3160. var bEqualsTo = false;
  3161.  
  3162. for (var i in aPathValue) {
  3163. bEqualsTo = false;
  3164. for (var j in aPathContext) {
  3165. if (aPathContext[j] === aPathValue[i]) {
  3166. bEqualsTo = true;
  3167. break;
  3168. }
  3169. }
  3170. if (bEqualsTo === false) {
  3171. aPathContext.push(aPathValue[i]);
  3172. }
  3173. }
  3174.  
  3175. var sPathUpdated = aPathContext.join("/") + "/updated";
  3176. var oValue = oEvent.getSource().getDateValue();
  3177.  
  3178. if (this.validateDateField(oValue)) {
  3179. this.getView().getModel().setProperty(sPathUpdated, true);
  3180. } else {
  3181. this.getView().getModel().setProperty(sPathUpdated, false);
  3182. }
  3183.  
  3184. //Force refreshModel
  3185. sPathValue = aPathContext.join("/") + "/value";
  3186. this.getView().getModel().setProperty(sPathValue, oValue);
  3187.  
  3188. //If the user is in the Patient Master Data, change text color to green
  3189. if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
  3190. this.getView().getModel().getProperty(sPathUpdated) &&
  3191. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  3192. oEvent.getSource().removeStyleClass("fs_ws_gray3_color");
  3193. oEvent.getSource().addStyleClass("fs_ws_positive_color");
  3194. }
  3195. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  3196. oEvent.getSource().removeStyleClass("fs_ws_positive_color");
  3197. oEvent.getSource().addStyleClass("fs_ws_gray3_color");
  3198. }
  3199.  
  3200. //Change the checkSubmit field in order to trigger the getEnabledButton
  3201. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  3202.  
  3203. },
  3204.  
  3205. /**
  3206. * This function puts the field update when the email field is filled
  3207. *
  3208. * @author José Graça
  3209. */
  3210. setFieldUpdatedFlagForEmail: function(oEvent) {
  3211. var oElement = oEvent.getSource();
  3212. var sPathValue = oElement.getBindingPath("value");
  3213. var aPathValue = sPathValue.split("/");
  3214. aPathValue.pop();
  3215. var aPathContext;
  3216.  
  3217. if (oElement.getBindingContext()) {
  3218. aPathContext = oElement.getBindingContext().getPath().split("/");
  3219. } else {
  3220. aPathContext = [];
  3221. }
  3222.  
  3223. var bEqualsTo = false;
  3224.  
  3225. for (var i in aPathValue) {
  3226. bEqualsTo = false;
  3227. for (var j in aPathContext) {
  3228. if (aPathContext[j] === aPathValue[i]) {
  3229. bEqualsTo = true;
  3230. break;
  3231. }
  3232. }
  3233. if (bEqualsTo === false) {
  3234. aPathContext.push(aPathValue[i]);
  3235. }
  3236. }
  3237.  
  3238. var sPathUpdated = aPathContext.join("/") + "/updated";
  3239. var sValue = oEvent.getParameter("value");
  3240.  
  3241. if (this.validateEmailField(sValue)) {
  3242. this.getView().getModel().setProperty(sPathUpdated, true);
  3243. } else {
  3244. this.getView().getModel().setProperty(sPathUpdated, false);
  3245. }
  3246.  
  3247. //Force refreshModel
  3248. sPathValue = aPathContext.join("/") + "/value";
  3249. this.getView().getModel().setProperty(sPathValue, sValue);
  3250.  
  3251. //If the user is in the Patient Master Data, change text color to green
  3252. if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
  3253. this.getView().getModel().getProperty(sPathUpdated) &&
  3254. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  3255. oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
  3256. oEvent.getSource().addStyleClass("fs_ws_positive_color");
  3257. }
  3258. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  3259. oEvent.getSource().removeStyleClass("fs_ws_positive_color");
  3260. oEvent.getSource().addStyleClass("fs_ws_gray1_color");
  3261. }
  3262.  
  3263. //Change the checkSubmit field in order to trigger the getEnabledButton
  3264. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  3265.  
  3266. },
  3267.  
  3268. /**
  3269. * This function puts the field update when the boolean field is filled
  3270. *
  3271. * @author José Graça
  3272. */
  3273. setFieldUpdatedFlagForBoolean: function(oEvent) {
  3274. var oElement = oEvent.getSource();
  3275. var sPathValue = oElement.getBindingPath("selected");
  3276. var aPathValue = sPathValue.split("/");
  3277. aPathValue.pop();
  3278. var aPathContext;
  3279.  
  3280. if (oElement.getBindingContext()) {
  3281. aPathContext = oElement.getBindingContext().getPath().split("/");
  3282. } else {
  3283. aPathContext = [];
  3284. }
  3285.  
  3286. var bEqualsTo = false;
  3287.  
  3288. for (var i in aPathValue) {
  3289. for (var j in aPathContext) {
  3290. if (aPathContext[j] === aPathValue[i]) {
  3291. bEqualsTo = true;
  3292. break;
  3293. }
  3294. }
  3295. if (bEqualsTo === false) {
  3296. aPathContext.push(aPathValue[i]);
  3297. }
  3298. }
  3299.  
  3300. var sPathUpdated = aPathContext.join("/") + "/updated";
  3301.  
  3302. this.getView().getModel().setProperty(sPathUpdated, true);
  3303.  
  3304. sPathValue = aPathContext.join("/") + "/value";
  3305. //If the user is in the Patient Master Data, change text color to green
  3306. if(this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value")){
  3307. var oText = oEvent.getSource();
  3308. var oCheckBox = oEvent.getSource();
  3309. if(oEvent.getSource().getText()===""){
  3310. oText = oEvent.getSource().getParent().getItems()[1];
  3311. }
  3312. if(sap.ui.getCore().getModel().getProperty(sPathValue) !== undefined){
  3313. if( this.getView().getModel().getProperty(sPathUpdated) &&
  3314. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  3315. oText.removeStyleClass("fs_ws_gray1_color");
  3316. oText.addStyleClass("fs_ws_positive_color");
  3317. oCheckBox.addStyleClass("fs_ws_positive_checkbox");
  3318.  
  3319.  
  3320. }
  3321. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  3322. oCheckBox.removeStyleClass("fs_ws_positive_checkbox");
  3323. oText.removeStyleClass("fs_ws_positive_color");
  3324. oText.addStyleClass("fs_ws_gray1_color");
  3325. }
  3326. }
  3327. else{
  3328. if( this.getView().getModel().getProperty(sPathUpdated) &&
  3329. false !== this.getView().getModel().getProperty(sPathValue)){
  3330. oText.removeStyleClass("fs_ws_gray1_color");
  3331. oText.addStyleClass("fs_ws_positive_color");
  3332. oCheckBox.addStyleClass("fs_ws_positive_checkbox");
  3333.  
  3334.  
  3335. }
  3336. else if(false === this.getView().getModel().getProperty(sPathValue)){
  3337. oCheckBox.removeStyleClass("fs_ws_positive_checkbox");
  3338. oText.removeStyleClass("fs_ws_positive_color");
  3339. oText.addStyleClass("fs_ws_gray1_color");
  3340. }
  3341. }
  3342. }
  3343.  
  3344. //Change the checkSubmit field in order to trigger the getEnabledButton
  3345. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  3346.  
  3347. },
  3348.  
  3349. /**
  3350. * This function puts the field update when the radio button field is filled
  3351. *
  3352. * @author José Graça
  3353. */
  3354. setFieldUpdatedFlagForRadioButton: function(oEvent) {
  3355. var oElement = oEvent.getSource();
  3356. var sPathValue = oElement.getBindingPath("selectedIndex");
  3357. var aPathValue = sPathValue.split("/");
  3358. aPathValue.pop();
  3359. var aPathContext;
  3360.  
  3361. if (oElement.getBindingContext()) {
  3362. aPathContext = oElement.getBindingContext().getPath().split("/");
  3363. } else {
  3364. aPathContext = [];
  3365. }
  3366.  
  3367. var bEqualsTo = false;
  3368.  
  3369. for (var i in aPathValue) {
  3370. bEqualsTo = false;
  3371. for (var j in aPathContext) {
  3372. if (aPathContext[j] === aPathValue[i]) {
  3373. bEqualsTo = true;
  3374. break;
  3375. }
  3376. }
  3377. if (bEqualsTo === false) {
  3378. aPathContext.push(aPathValue[i]);
  3379. }
  3380. }
  3381.  
  3382. var sPathUpdated = aPathContext.join("/") + "/updated";
  3383.  
  3384. var sValue = oEvent.getParameter("selectedIndex");
  3385. if (sValue > -1) {
  3386. this.getView().getModel().setProperty(sPathUpdated, true);
  3387. }
  3388.  
  3389. sPathValue = aPathContext.join("/") + "/value";
  3390. //If the user is in the Patient Master Data, change text color to green
  3391. if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
  3392. this.getView().getModel().getProperty(sPathUpdated) &&
  3393. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  3394. var iValue = sap.ui.getCore().getModel().getProperty(sPathValue);
  3395. for(var z=0; z< oEvent.getSource().getButtons().length ; z++){
  3396. var oThisRadioButton = oEvent.getSource().getButtons()[z];
  3397. oThisRadioButton.removeStyleClass("fs_ws_positive_radiobutton");
  3398. oThisRadioButton.removeStyleClass("fs_ws_positive_color");
  3399. oThisRadioButton.addStyleClass("fs_ws_gray1_color");
  3400. }
  3401. oEvent.getSource().getSelectedButton(iValue).removeStyleClass("fs_ws_gray1_color");
  3402. oEvent.getSource().getSelectedButton(iValue).addStyleClass("fs_ws_positive_color");
  3403. oEvent.getSource().getSelectedButton(iValue).addStyleClass("fs_ws_positive_radiobutton");
  3404. }
  3405. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  3406. for(var z=0; z< oEvent.getSource().getButtons().length ; z++){
  3407. var oThisRadioButton = oEvent.getSource().getButtons()[z];
  3408. oThisRadioButton.removeStyleClass("fs_ws_positive_radiobutton");
  3409. oThisRadioButton.removeStyleClass("fs_ws_positive_color");
  3410. oThisRadioButton.addStyleClass("fs_ws_gray1_color");
  3411. }
  3412. }
  3413.  
  3414. //Change the checkSubmit field in order to trigger the getEnabledButton
  3415. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  3416.  
  3417. },
  3418.  
  3419. /**
  3420. * This function puts the field update when the select field is filled
  3421. *
  3422. * @author José Graça
  3423. */
  3424. setFieldUpdatedFlagForSelect: function(oEvent) {
  3425. var oElement = oEvent.getSource();
  3426. var sPathValue = oElement.getBindingPath("selectedKey");
  3427. var aPathValue = sPathValue.split("/");
  3428. aPathValue.pop();
  3429. var aPathContext;
  3430.  
  3431. if (oElement.getBindingContext()) {
  3432. aPathContext = oElement.getBindingContext().getPath().split("/");
  3433. } else {
  3434. aPathContext = [];
  3435. }
  3436.  
  3437. var bEqualsTo = false;
  3438.  
  3439. for (var i in aPathValue) {
  3440. bEqualsTo = false;
  3441. for (var j in aPathContext) {
  3442. if (aPathContext[j] === aPathValue[i]) {
  3443. bEqualsTo = true;
  3444. break;
  3445. }
  3446. }
  3447. if (bEqualsTo === false) {
  3448. aPathContext.push(aPathValue[i]);
  3449. }
  3450. }
  3451.  
  3452. var sPathUpdated = aPathContext.join("/") + "/updated";
  3453. var sValue = oEvent.getSource().getSelectedKey();
  3454.  
  3455. if (this.validateStringField(sValue)) {
  3456. this.getView().getModel().setProperty(sPathUpdated, true);
  3457. } else {
  3458. this.getView().getModel().setProperty(sPathUpdated, false);
  3459. }
  3460.  
  3461. //Force refreshModel
  3462. sPathValue = aPathContext.join("/") + "/value";
  3463. this.getView().getModel().setProperty(sPathValue, sValue);
  3464.  
  3465. sPathValue = aPathContext.join("/") + "/value";
  3466. //If the user is in the Patient Master Data, change text color to green
  3467. if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
  3468. this.getView().getModel().getProperty(sPathUpdated) &&
  3469. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  3470. oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
  3471. oEvent.getSource().addStyleClass("fs_ws_positive_color");
  3472. }
  3473. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  3474. oEvent.getSource().removeStyleClass("fs_ws_positive_color");
  3475. oEvent.getSource().addStyleClass("fs_ws_gray1_color");
  3476. }
  3477.  
  3478. //Change the checkSubmit field in order to trigger the getEnabledButton
  3479. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  3480.  
  3481. },
  3482.  
  3483.  
  3484. /**
  3485. * This function puts the field update when the hours field is filled
  3486. *
  3487. * @author José Graça
  3488. */
  3489. setFieldUpdatedFlagForHours: function(oEvent) {
  3490. var oElement = oEvent.getSource();
  3491. var sPathValue = oElement.getBindingPath("value");
  3492. var aPathValue = sPathValue.split("/");
  3493. aPathValue.pop();
  3494. var aPathContext;
  3495.  
  3496. if (oElement.getBindingContext()) {
  3497. aPathContext = oElement.getBindingContext().getPath().split("/");
  3498. } else {
  3499. aPathContext = [];
  3500. }
  3501.  
  3502. var bEqualsTo = false;
  3503.  
  3504. for (var i in aPathValue) {
  3505. bEqualsTo = false;
  3506. for (var j in aPathContext) {
  3507. if (aPathContext[j] === aPathValue[i]) {
  3508. bEqualsTo = true;
  3509. break;
  3510. }
  3511. }
  3512. if (bEqualsTo === false) {
  3513. aPathContext.push(aPathValue[i]);
  3514. }
  3515. }
  3516.  
  3517. var sPathUpdated = aPathContext.join("/") + "/updated";
  3518. var oValue = oEvent.getSource().getValue();
  3519.  
  3520. if (this.validateHoursField(oValue)) {
  3521. this.getView().getModel().setProperty(sPathUpdated, true);
  3522. } else {
  3523. this.getView().getModel().setProperty(sPathUpdated, false);
  3524. }
  3525.  
  3526. //Force refreshModel
  3527. sPathValue = aPathContext.join("/") + "/value";
  3528. this.getView().getModel().setProperty(sPathValue, oValue);
  3529.  
  3530. //If the user is in the Patient Master Data, change text color to green
  3531. if( this.getView().getModel().getProperty("/patient/changeRequest/inPatientMasterData/value") &&
  3532. this.getView().getModel().getProperty(sPathUpdated) &&
  3533. sap.ui.getCore().getModel().getProperty(sPathValue) !== this.getView().getModel().getProperty(sPathValue)){
  3534. oEvent.getSource().removeStyleClass("fs_ws_gray1_color");
  3535. oEvent.getSource().addStyleClass("fs_ws_positive_color");
  3536. }
  3537. else if(sap.ui.getCore().getModel().getProperty(sPathValue) === this.getView().getModel().getProperty(sPathValue)){
  3538. oEvent.getSource().removeStyleClass("fs_ws_positive_color");
  3539. oEvent.getSource().addStyleClass("fs_ws_gray1_color");
  3540. }
  3541.  
  3542. //Change the checkSubmit field in order to trigger the getEnabledButton
  3543. this.getView().getModel().setProperty("/patient/checkSubmit", !this.getView().getModel().getProperty("/patient/checkSubmit"));
  3544.  
  3545.  
  3546. },
  3547.  
  3548. /**
  3549. * Get as parameter the index of the contact, and reset the view model fields of that contact.
  3550. *
  3551. * @author Tiago Martins
  3552. */
  3553. resetContact: function(iIndex) {
  3554. var aContacts = this.getView().getModel().getProperty("/patient/patientContacts");
  3555.  
  3556. aContacts[iIndex].gender.value = -1;
  3557. aContacts[iIndex].gender.updated = false;
  3558. aContacts[iIndex].firstName.value = "";
  3559. aContacts[iIndex].firstName.updated = false;
  3560. aContacts[iIndex].lastName.value = "";
  3561. aContacts[iIndex].lastName.updated = false;
  3562. aContacts[iIndex].street.value = "";
  3563. aContacts[iIndex].street.updated = false;
  3564. aContacts[iIndex].additionalStreet.value = "";
  3565. aContacts[iIndex].additionalStreet.updated = false;
  3566. aContacts[iIndex].zipCode.value = "";
  3567. aContacts[iIndex].zipCode.updated = false;
  3568. aContacts[iIndex].city.value = "";
  3569. aContacts[iIndex].city.updated = false;
  3570. aContacts[iIndex].tel.value = "";
  3571. aContacts[iIndex].tel.updated = false;
  3572. aContacts[iIndex].tels = [];
  3573. aContacts[iIndex].fax.value = "";
  3574. aContacts[iIndex].fax.updated = false;
  3575. aContacts[iIndex].email.value = "";
  3576. aContacts[iIndex].email.updated = false;
  3577. aContacts[iIndex].institutionName.value = "";
  3578. aContacts[iIndex].institutionName.updated = false;
  3579. //Uncheck livesWith CheckBox
  3580. /*if(aContacts[iIndex].livesWith){
  3581. var oFragment = this.FragPatientContactOtherContact.getItems()[0].getItems()[2].getItems()[0].getItems()[iIndex].getContent()[0].getItems()[1];
  3582. oFragment.getItems()[4].getItems()[0].getItems()[0].getItems()[0].setProperty("selected",false);
  3583. }*/
  3584. aContacts[iIndex].livesWith.value = false;
  3585. aContacts[iIndex].livesWith.updated = false;
  3586. aContacts[iIndex].isLegalGuardian.value = false;
  3587. aContacts[iIndex].isLegalGuardian.updated = false;
  3588. aContacts[iIndex].isPersonContact.value = false;
  3589. aContacts[iIndex].isPersonContact.updated = false;
  3590. aContacts[iIndex].firstVisit.value = false;
  3591. aContacts[iIndex].firstVisit.updated = false;
  3592. },
  3593. //oModel = this.getView().getModel().getProperty("/patient")
  3594.  
  3595.  
  3596. /**
  3597. * This function puts all updates of the model with false
  3598. *
  3599. * @author Maria Araújo
  3600. */
  3601. cleanModelUpdate: function(oModel) {
  3602. var i, j = 0;
  3603. oModel = oModel.getProperty("/patient");
  3604. oModel.checkSubmit = false;
  3605.  
  3606. //info
  3607. oModel.info.id.updated = false;
  3608. oModel.info.gender.updated = false;
  3609. oModel.info.firstName.updated = false;
  3610. oModel.info.lastName.updated = false;
  3611. oModel.info.dateOfBirth.updated = false;
  3612. oModel.info.datePatientRequest.updated = false;
  3613. oModel.info.street.updated = false;
  3614. oModel.info.additionalStreet.updated = false;
  3615. oModel.info.access.updated = false;
  3616. oModel.info.zipCode.updated = false;
  3617. oModel.info.city.updated = false;
  3618. oModel.info.tel.updated = false;
  3619. for (i = 0; i < oModel.info.tels.length; i++) {
  3620. oModel.info.tels[i].updated = false;
  3621. }
  3622. oModel.info.fax.updated = false;
  3623. oModel.info.email.updated = false;
  3624. oModel.info.circumstancesaAtDischarge.updated = false;
  3625. oModel.info.therapeuticAreaPE.updated = false;
  3626. oModel.info.therapeuticAreaEE.updated = false;
  3627. oModel.info.therapeuticAreaWV.updated = false;
  3628. oModel.info.therapeuticAreaTS.updated = false;
  3629. oModel.info.height.updated = false;
  3630. oModel.info.weight.updated = false;
  3631. oModel.info.previousWeight.updated = false;
  3632. oModel.info.bmi.updated = false;
  3633. oModel.info.patientSick.updated = false;
  3634. oModel.info.foodReduced.updated = false;
  3635. oModel.info.lostWeight.updated = false;
  3636. oModel.info.whereIsPatient.updated = false;
  3637. oModel.info.acceptment.updated = false;
  3638. oModel.info.freeTextJustification.updated = false;
  3639. oModel.info.accepted.updated = false;
  3640. oModel.info.notCheckedSimilar.updated = false;
  3641.  
  3642. //firstVisit
  3643. oModel.firstVisit.locationType.updated = false;
  3644. oModel.firstVisit.street.updated = false;
  3645. oModel.firstVisit.additionalStreet.updated = false;
  3646. oModel.firstVisit.zipCode.updated = false;
  3647. oModel.firstVisit.city.updated = false;
  3648. oModel.firstVisit.access.updated = false;
  3649. oModel.firstVisit.dateBegin.updated = false;
  3650. oModel.firstVisit.dateEnd.updated = false;
  3651. oModel.firstVisit.initialDoctorSelected.updated = false;
  3652. for (i = 0; i < oModel.firstVisit.participants.length; i++) {
  3653. oModel.firstVisit.participants[i].firstName.updated = false;
  3654. oModel.firstVisit.participants[i].lastName.updated = false;
  3655. oModel.firstVisit.participants[i].role.updated = false;
  3656. oModel.firstVisit.participants[i].isSelected.updated = false;
  3657. }
  3658.  
  3659. //reportingInstitution
  3660. oModel.reportingInstitution.institution.updated = false;
  3661. oModel.reportingInstitution.organization.updated = false;
  3662. oModel.reportingInstitution.street.updated = false;
  3663. oModel.reportingInstitution.additionalStreet.updated = false;
  3664. oModel.reportingInstitution.tel.updated = false;
  3665. oModel.reportingInstitution.fax.updated = false;
  3666. oModel.reportingInstitution.email.updated = false;
  3667. oModel.reportingInstitution.zipCode.updated = false;
  3668. oModel.reportingInstitution.city.updated = false;
  3669.  
  3670. //deliveryAddress
  3671. oModel.deliveryAddress.streetNew.updated = false;
  3672. oModel.deliveryAddress.additionalStreetNew.updated = false;
  3673. oModel.deliveryAddress.zipCodeNew.updated = false;
  3674. oModel.deliveryAddress.cityNew.updated = false;
  3675. oModel.deliveryAddress.addressOptions.updated = false;
  3676. oModel.deliveryAddress.receiver.updated = false;
  3677. oModel.deliveryAddress.desiredVisitTimeFrom.updated = false;
  3678. oModel.deliveryAddress.desiredVisitTimeTo.updated = false;
  3679.  
  3680. //prescribingPhysician
  3681. oModel.prescribingPhysician.previousDoctorFlag.updated = false;
  3682. oModel.prescribingPhysician.previvousPhysician.previousPhysicianType.updated = false;
  3683. oModel.prescribingPhysician.previvousPhysician.previousInstitution.type.updated = false;
  3684. oModel.prescribingPhysician.previvousPhysician.previousInstitution.name.updated = false;
  3685. oModel.prescribingPhysician.previvousPhysician.previousInstitution.street.updated = false;
  3686. oModel.prescribingPhysician.previvousPhysician.previousInstitution.additionalStreet.updated = false;
  3687. oModel.prescribingPhysician.previvousPhysician.previousInstitution.zipCode.updated = false;
  3688. oModel.prescribingPhysician.previvousPhysician.previousInstitution.city.updated = false;
  3689. oModel.prescribingPhysician.previvousPhysician.previousInstitution.tel.updated = false;
  3690. oModel.prescribingPhysician.previvousPhysician.previousInstitution.fax.updated = false;
  3691. oModel.prescribingPhysician.previvousPhysician.previousInstitution.email.updated = false;
  3692. oModel.prescribingPhysician.previvousPhysician.previousInstitution.details.updated = false;
  3693. oModel.prescribingPhysician.previvousPhysician.previousInstitution.doctorGenre.updated = false;
  3694. oModel.prescribingPhysician.previvousPhysician.previousInstitution.doctorFirstName.updated = false;
  3695. oModel.prescribingPhysician.previvousPhysician.previousInstitution.doctorLastName.updated = false;
  3696. oModel.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.updated = false;
  3697. oModel.prescribingPhysician.previvousPhysician.previousInstitution.newFax.updated = false;
  3698. oModel.prescribingPhysician.previvousPhysician.previousInstitution.otherFax.update = false;
  3699. oModel.prescribingPhysician.previvousPhysician.previousDoctor.name.updated = false;
  3700. oModel.prescribingPhysician.previvousPhysician.previousDoctor.speciality.updated = false;
  3701. oModel.prescribingPhysician.previvousPhysician.previousDoctor.street.updated = false;
  3702. oModel.prescribingPhysician.previvousPhysician.previousDoctor.additionalStreet.updated = false;
  3703. oModel.prescribingPhysician.previvousPhysician.previousDoctor.zipCode.updated = false;
  3704. oModel.prescribingPhysician.previvousPhysician.previousDoctor.city.updated = false;
  3705. oModel.prescribingPhysician.previvousPhysician.previousDoctor.tel.updated = false;
  3706. oModel.prescribingPhysician.previvousPhysician.previousDoctor.fax.updated = false;
  3707. oModel.prescribingPhysician.previvousPhysician.previousDoctor.email.updated = false;
  3708. oModel.prescribingPhysician.previvousPhysician.previousDoctor.timeSchedule.updated = false;
  3709. for (i = 0; i < oModel.prescribingPhysician.prescribingDoctor.length; i++) {
  3710. oModel.prescribingPhysician.prescribingDoctor[i].name.updated = false;
  3711. oModel.prescribingPhysician.prescribingDoctor[i].speciality.updated = false;
  3712. oModel.prescribingPhysician.prescribingDoctor[i].street.updated = false;
  3713. oModel.prescribingPhysician.prescribingDoctor[i].additionalStreet.updated = false;
  3714. oModel.prescribingPhysician.prescribingDoctor[i].zipCode.updated = false;
  3715. oModel.prescribingPhysician.prescribingDoctor[i].city.updated = false;
  3716. oModel.prescribingPhysician.prescribingDoctor[i].tel.updated = false;
  3717. oModel.prescribingPhysician.prescribingDoctor[i].fax.updated = false;
  3718. oModel.prescribingPhysician.prescribingDoctor[i].email.updated = false;
  3719. oModel.prescribingPhysician.prescribingDoctor[i].timeSchedule.updated = false;
  3720. oModel.prescribingPhysician.prescribingDoctor[i].therapeuticAreaEE.updated = false;
  3721. oModel.prescribingPhysician.prescribingDoctor[i].therapeuticAreaPE.updated = false;
  3722. oModel.prescribingPhysician.prescribingDoctor[i].therapeuticAreaTS.updated = false;
  3723. oModel.prescribingPhysician.prescribingDoctor[i].therapeuticAreaWV.updated = false;
  3724. oModel.prescribingPhysician.prescribingDoctor[i].otherTherapeuticArea.updated = false;
  3725. oModel.prescribingPhysician.prescribingDoctor[i].holidays.updated = false;
  3726. oModel.prescribingPhysician.prescribingDoctor[i].holidaysFrom.updated = false;
  3727. oModel.prescribingPhysician.prescribingDoctor[i].holidaysTo.updated = false;
  3728. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.name.updated = false;
  3729. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.speciality.updated = false;
  3730. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.street.updated = false;
  3731. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.additionalStreet.updated = false;
  3732. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.zipCode.updated = false;
  3733. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.city.updated = false;
  3734. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.tel.updated = false;
  3735. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.fax.updated = false;
  3736. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.email.updated = false;
  3737. oModel.prescribingPhysician.prescribingDoctor[i].temporaryDoctor.timeSchedule.updated = false;
  3738. }
  3739.  
  3740. //dischargeInstitution
  3741. oModel.dischargeInstitution.type.updated = false;
  3742. oModel.dischargeInstitution.name.updated = false;
  3743. oModel.dischargeInstitution.street.updated = false;
  3744. oModel.dischargeInstitution.additionalStreet.updated = false;
  3745. oModel.dischargeInstitution.zipCode.updated = false;
  3746. oModel.dischargeInstitution.city.updated = false;
  3747. oModel.dischargeInstitution.tel.updated = false;
  3748. oModel.dischargeInstitution.fax.updated = false;
  3749. oModel.dischargeInstitution.email.updated = false;
  3750. oModel.dischargeInstitution.details.updated = false;
  3751. oModel.dischargeInstitution.doctorGenre.updated = false;
  3752. oModel.dischargeInstitution.doctorFirstName.updated = false;
  3753. oModel.dischargeInstitution.doctorLastName.updated = false;
  3754. oModel.dischargeInstitution.dischargeDate.updated = false;
  3755. oModel.dischargeInstitution.newFax.updated = false;
  3756. oModel.dischargeInstitution.otherFax.updated = false;
  3757.  
  3758. //careSituation
  3759. oModel.careSituation.careSituationType.updated = false;
  3760. oModel.careSituation.name.updated = false;
  3761. oModel.careSituation.street.updated = false;
  3762. oModel.careSituation.additionalStreet.updated = false;
  3763. oModel.careSituation.zipCode.updated = false;
  3764. oModel.careSituation.city.updated = false;
  3765. oModel.careSituation.tel.updated = false;
  3766. oModel.careSituation.fax.updated = false;
  3767. oModel.careSituation.email.updated = false;
  3768. oModel.careSituation.access.updated = false;
  3769. oModel.careSituation.farFromStreet.updated = false;
  3770. oModel.careSituation.withoutElevator.updated = false;
  3771. oModel.careSituation.notForWheelchair.updated = false;
  3772. oModel.careSituation.parkingMorning.updated = false;
  3773. oModel.careSituation.parkingNoon.updated = false;
  3774. oModel.careSituation.parkingEvening.updated = false;
  3775. oModel.careSituation.desiredVisitTimeFrom.updated = false;
  3776. oModel.careSituation.desiredVisitTimeTo.updated = false;
  3777.  
  3778. //livingConditionsInfo
  3779. oModel.livingConditionsInfo.data.updated = false;
  3780. oModel.livingConditionsInfo.spaceCare.updated = false;
  3781. oModel.livingConditionsInfo.spaceRefrigerator.updated = false;
  3782. oModel.livingConditionsInfo.spaceGadgets.updated = false;
  3783. oModel.livingConditionsInfo.spaceProductBoxes.updated = false;
  3784. oModel.livingConditionsInfo.thereIsWater.updated = false;
  3785. oModel.livingConditionsInfo.thereIsElectricity.updated = false;
  3786. oModel.livingConditionsInfo.thereIsPets.updated = false;
  3787.  
  3788. //patientContatcs
  3789. for (i = 0; i < oModel.patientContacts.length; i++) {
  3790. oModel.patientContacts[i].gender.updated = false;
  3791. oModel.patientContacts[i].firstName.updated = false;
  3792. oModel.patientContacts[i].lastName.updated = false;
  3793. oModel.patientContacts[i].street.updated = false;
  3794. oModel.patientContacts[i].additionalStreet.updated = false;
  3795. oModel.patientContacts[i].zipCode.updated = false;
  3796. oModel.patientContacts[i].city.updated = false;
  3797. oModel.patientContacts[i].tel.updated = false;
  3798. for (j = 0; j < oModel.patientContacts[i].tels.length; j++) {
  3799. oModel.patientContacts[i].tels[j].updated = false;
  3800. }
  3801. oModel.patientContacts[i].fax.updated = false;
  3802. oModel.patientContacts[i].email.updated = false;
  3803. oModel.patientContacts[i].institutionName.updated = false;
  3804. oModel.patientContacts[i].type.updated = false;
  3805. oModel.patientContacts[i].livesWith.updated = false;
  3806. oModel.patientContacts[i].isLegalGuardian.updated = false;
  3807. oModel.patientContacts[i].isPersonContact.updated = false;
  3808. oModel.patientContacts[i].firstVisit.updated = false;
  3809. }
  3810.  
  3811. //pharmacy
  3812. oModel.pharmacy.name.updated = false;
  3813. oModel.pharmacy.street.updated = false;
  3814. oModel.pharmacy.additionalStreet.updated = false;
  3815. oModel.pharmacy.zipCode.updated = false;
  3816. oModel.pharmacy.city.updated = false;
  3817. oModel.pharmacy.tel.updated = false;
  3818. oModel.pharmacy.fax.updated = false;
  3819. oModel.pharmacy.email.updated = false;
  3820. oModel.pharmacy.timeSchedule.updated = false;
  3821. oModel.insurance.institutionName.updated = false;
  3822. oModel.insurance.street.updated = false;
  3823. oModel.insurance.zipCode.updated = false;
  3824. oModel.insurance.city.updated = false;
  3825. oModel.insurance.tel.updated = false;
  3826. oModel.insurance.fax.updated = false;
  3827. oModel.insurance.email.updated = false;
  3828. oModel.insurance.memberShipNumber.updated = false;
  3829. oModel.insurance.type.updated = false;
  3830. oModel.insurance.paymentStatus.updated = false;
  3831. oModel.insurance.uploadedPayment.updated = false;
  3832. oModel.insurance.uploadedDatePayment.updated = false;
  3833. oModel.insurance.payers.updated = false;
  3834. oModel.insurance.uploadedPayers.updated = false;
  3835. oModel.insurance.uploadedDatePayers.updated = false;
  3836. oModel.insurance.careLevel.updated = false;
  3837. oModel.consent.care.updated = false;
  3838. oModel.consent.data.updated = false;
  3839. oModel.consent.photographic.updated = false;
  3840. oModel.consent.telephone.updated = false;
  3841. oModel.consent.revoke.updated = false;
  3842. oModel.consent.date.updated = false;
  3843.  
  3844. //changeRequest
  3845. if(oModel.changeRequest){
  3846. oModel.changeRequest.changeDate.updated = false;
  3847. oModel.changeRequest.changeReason.updated = false;
  3848. oModel.changeRequest.rejectReason.updated = false;
  3849. }
  3850.  
  3851.  
  3852. },
  3853.  
  3854. /**
  3855. * This function transforms all the dates to an object
  3856. *
  3857. * @author José Graça
  3858. */
  3859. setDatesAsObject: function(oData) {
  3860. if(oData.info){
  3861. if(oData.info.dateOfBirth.value){
  3862. oData.info.dateOfBirth.value = new Date(oData.info.dateOfBirth.value);
  3863. }
  3864. if(oData.info.healthCheckDate.value){
  3865. oData.info.healthCheckDate.value = new Date(oData.info.healthCheckDate.value);
  3866. } else{
  3867. oData.info.healthCheckDate.value = undefined;
  3868. }
  3869. }
  3870. if(oData.firstVisit){
  3871. if(oData.firstVisit.dateBegin.value){
  3872. oData.firstVisit.dateBegin.value = new Date(oData.firstVisit.dateBegin.value);
  3873. } else{
  3874. oData.firstVisit.dateBegin.value = undefined;
  3875. }
  3876. if(oData.firstVisit.dateEnd.value){
  3877. oData.firstVisit.dateEnd.value = new Date(oData.firstVisit.dateEnd.value);
  3878. } else{
  3879. oData.firstVisit.dateEnd.value = undefined;
  3880. }
  3881. }
  3882. if(oData.prescribingPhysician){
  3883. if(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value){
  3884. oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value = new Date(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value);
  3885. } else{
  3886. oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value = undefined;
  3887. }
  3888.  
  3889. for(var i in oData.prescribingPhysician.prescribingDoctor){
  3890. if(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value){
  3891. oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value = new Date(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value);
  3892. } else{
  3893. oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value = undefined;
  3894. }
  3895. if(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value){
  3896. oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value = new Date(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value);
  3897. } else{
  3898. oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value = undefined;
  3899. }
  3900. }
  3901. }
  3902. if(oData.dischargeInstitution){
  3903. if(oData.dischargeInstitution.dischargeDate.value){
  3904. oData.dischargeInstitution.dischargeDate.value = new Date(oData.dischargeInstitution.dischargeDate.value);
  3905. } else{
  3906. oData.dischargeInstitution.dischargeDate.value = undefined;
  3907. }
  3908. }
  3909. if(oData.consent){
  3910. if(oData.consent.date.value){
  3911. oData.consent.date.value = new Date(oData.consent.date.value);
  3912. } else{
  3913. oData.consent.date.value = undefined;
  3914. }
  3915. }
  3916. if(oData.changeRequest){
  3917. if(oData.changeRequest.changeDate.value){
  3918. oData.changeRequest.changeDate.value = new Date(oData.changeRequest.changeDate.value);
  3919. } else{
  3920. oData.changeRequest.changeDate.value = undefined;
  3921. }
  3922. }
  3923.  
  3924. return oData;
  3925. },
  3926.  
  3927. /**
  3928. * This function sets date to utc timezone
  3929. *
  3930. * @author José Graça
  3931. */
  3932. setRetrievedDatesAsUTC: function(oData){
  3933.  
  3934. if(oData.info){
  3935. if(oData.info.dateOfBirth.value){
  3936. oData.info.dateOfBirth.value = new Date(oData.info.dateOfBirth.value.getTime()+oData.info.dateOfBirth.value.getTimezoneOffset()*60000);
  3937. }
  3938. if(oData.info.healthCheckDate.value){
  3939. oData.info.healthCheckDate.value = new Date(oData.info.healthCheckDate.value.getTime()+oData.info.healthCheckDate.value.getTimezoneOffset()*60000);
  3940. }
  3941. }
  3942. if(oData.firstVisit){
  3943. if(oData.firstVisit.dateBegin.value){
  3944. oData.firstVisit.dateBegin.value = new Date(oData.firstVisit.dateBegin.value.getTime()+oData.firstVisit.dateBegin.value.getTimezoneOffset()*60000);
  3945. }
  3946. if(oData.firstVisit.dateEnd.value){
  3947. oData.firstVisit.dateEnd.value = new Date(oData.firstVisit.dateEnd.value.getTime()+oData.firstVisit.dateEnd.value.getTimezoneOffset()*60000);
  3948. }
  3949. }
  3950. if(oData.prescribingPhysician){
  3951. if(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value){
  3952. oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value = new Date(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value.getTime()+oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value.getTimezoneOffset()*60000);
  3953. }
  3954. for(var i in oData.prescribingPhysician.prescribingDoctor){
  3955. if(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value){
  3956. oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value = new Date(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value.getTime()+oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value.getTimezoneOffset()*60000);
  3957. }
  3958. if(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value){
  3959. oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value = new Date(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value.getTime()+oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value.getTimezoneOffset()*60000);
  3960. }
  3961. }
  3962. }
  3963. if(oData.dischargeInstitution){
  3964. if(oData.dischargeInstitution.dischargeDate.value){
  3965. oData.dischargeInstitution.dischargeDate.value = new Date(oData.dischargeInstitution.dischargeDate.value.getTime()+oData.dischargeInstitution.dischargeDate.value.getTimezoneOffset()*60000);
  3966. }
  3967. }
  3968. if(oData.consent){
  3969. if(oData.consent.date.value){
  3970. oData.consent.date.value = new Date(oData.consent.date.value.getTime()+oData.consent.date.value.getTimezoneOffset()*60000);
  3971. }
  3972. }
  3973. if(oData.changeRequest){
  3974. if(oData.changeRequest.changeDate.value){
  3975. oData.changeRequest.changeDate.value = new Date(oData.changeRequest.changeDate.value.getTime()+oData.changeRequest.changeDate.value.getTimezoneOffset()*60000);
  3976. }
  3977. }
  3978.  
  3979. return oData;
  3980.  
  3981. },
  3982.  
  3983. /**
  3984. * This function transforms all the dates to a string in the format to send
  3985. *
  3986. * @author José Graça
  3987. */
  3988. prepareDatesToSend: function(oData) {
  3989.  
  3990. var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({
  3991. pattern: "yyyy-MM-ddTKK:mm:ss"
  3992. });
  3993.  
  3994. if(oData.info){
  3995. if(oData.info.dateOfBirth.value){
  3996. oData.info.dateOfBirth.value = oDateFormat.format(oData.info.dateOfBirth.value);
  3997. }
  3998. if(oData.info.healthCheckDate.value){
  3999. oData.info.healthCheckDate.value = oDateFormat.format(oData.info.healthCheckDate.value);
  4000. }
  4001. }
  4002. if(oData.firstVisit){
  4003. if(oData.firstVisit.dateBegin.value){
  4004. oData.firstVisit.dateBegin.value = oDateFormat.format(oData.firstVisit.dateBegin.value);
  4005. }
  4006. if(oData.firstVisit.dateEnd.value){
  4007. oData.firstVisit.dateEnd.value = oDateFormat.format(oData.firstVisit.dateEnd.value);
  4008. }
  4009. }
  4010. if(oData.prescribingPhysician){
  4011. if(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value){
  4012. oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value = oDateFormat.format(oData.prescribingPhysician.previvousPhysician.previousInstitution.dischargeDate.value);
  4013. }
  4014. for(var i in oData.prescribingPhysician.prescribingDoctor){
  4015. if(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value){
  4016. oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value = oDateFormat.format(oData.prescribingPhysician.prescribingDoctor[i].holidaysFrom.value);
  4017. }
  4018. if(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value){
  4019. oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value = oDateFormat.format(oData.prescribingPhysician.prescribingDoctor[i].holidaysTo.value);
  4020. }
  4021. }
  4022. }
  4023. if(oData.dischargeInstitution){
  4024. if(oData.dischargeInstitution.dischargeDate.value){
  4025. oData.dischargeInstitution.dischargeDate.value = oDateFormat.format(oData.dischargeInstitution.dischargeDate.value);
  4026. }
  4027. }
  4028. if(oData.consent){
  4029. if(oData.consent.date.value){
  4030. oData.consent.date.value = oDateFormat.format(oData.consent.date.value);
  4031. }
  4032. }
  4033. if(oData.changeRequest){
  4034. if(oData.changeRequest.changeDate.value){
  4035. oData.changeRequest.changeDate.value = oDateFormat.format(oData.changeRequest.changeDate.value);
  4036. }
  4037. }
  4038.  
  4039. return oData;
  4040. },
  4041. //Start - DHC-1588 - Code Insert - Maridine Reyes - 12-15-2016
  4042. navToWoundOverview: function(){
  4043. this.getRouter().navTo("WoundOverview");
  4044. },
  4045. //End - DHC-1588 - Code Insert - Maridine Reyes - 12-15-2016
  4046. //Start - DHC-1658 - Code Insert - Maridine Reyes - 01/05/2017
  4047. navToWoundStatus: function(){
  4048. this.getRouter().navTo("WoundStatus");
  4049. },
  4050. navToWoundConsent: function(){
  4051. this.getRouter().navTo("WoundConsent");
  4052. },
  4053. navToWoundComment: function(photosnr){
  4054. this.getRouter().navTo("WoundComment", {
  4055. photosnr: photosnr
  4056. });
  4057. }
  4058. //End - DHC-1658 - Code Insert - Maridine Reyes - 01/05/2017
  4059.  
  4060. });
  4061.  
  4062. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement