public Page( Physician ph, Rezept rp, String presID, String QRCode, Integer firstProductIndex, Integer lastProductIndex) { this.ph = ph; this.rp = rp; this.pat = rp.getPatient(); this.presID = presID; this.QRCode = QRCode; this.firstProd = firstProductIndex; this.lastProd = lastProductIndex; }
@Override public CdaCh getPrescriptionDocument(Rezept rezept) { CDACH clinicalDocument = CHFactory.eINSTANCE.createCDACH().init(); CdaChImpl ret = new CdaChImpl(clinicalDocument); ret.cSetPatient(EhcCoreMapper.getEhcPatient(rezept.getPatient())); // TODO OID muss richtig sein // create medication section MedicationsSection medicationsSection = IHEFactory.eINSTANCE.createMedicationsSection(); medicationsSection.setTitle(DatatypesFactory.eINSTANCE.createST("Aktuelle Medikation")); StrucDocText sdText = CDAFactory.eINSTANCE.createStrucDocText(); sdText.addText("Lisinopril HCT Streuli Tbl. 10/12.5 mg: 1-0-0"); medicationsSection.setText(sdText); medicationsSection.setCode( DatatypesFactory.eINSTANCE.createCE( "10160-0", "2.16.840.1.113883.6.1", "LOINC", "HISTORY OF MEDICATION USE")); medicationsSection.setId(DatatypesFactory.eINSTANCE.createII("2.16.756.5.30.1.105.1.6")); // define substance administration SubstanceAdministration substanceAdministration = CDAFactory.eINSTANCE.createSubstanceAdministration(); substanceAdministration .getTemplateIds() .add(DatatypesFactory.eINSTANCE.createII("2.16.756.5.30.1.1.1.1.1")); substanceAdministration .getIds() .add(DatatypesFactory.eINSTANCE.createII("2.16.756.5.30.2.6.1")); // code, system, systemname, displayname substanceAdministration.setCode( DatatypesFactory.eINSTANCE.createCD( "DRUG", "2.16.840.1.113883.5.4", "", "Medikamentöse Therapie")); substanceAdministration.setStatusCode(DatatypesFactory.eINSTANCE.createCS("completed")); substanceAdministration .getEffectiveTimes() .add(DatatypesFactory.eINSTANCE.createIVL_TS("20140807")); substanceAdministration.setPriorityCode( DatatypesFactory.eINSTANCE.createCE( "R", "2.16.840.1.113883.5.7", "ActPriority", "Routine")); substanceAdministration.setRouteCode( DatatypesFactory.eINSTANCE.createCE( "PO", "2.16.840.1.113883.5.112", "RouteOfAdministration", "schlucken, oral")); // set quantities IVL_PQ ivlQuantity = DatatypesFactory.eINSTANCE.createIVL_PQ(); ivlQuantity.setCenter(DatatypesFactory.eINSTANCE.createPQ(1, "1")); substanceAdministration.setDoseQuantity(ivlQuantity); IVL_PQ ivlRateQuantity = DatatypesFactory.eINSTANCE.createIVL_PQ(); ivlRateQuantity.setNullFlavor(NullFlavor.UNK); substanceAdministration.setRateQuantity(ivlQuantity); // set consumable medication Consumable consumable = CDAFactory.eINSTANCE.createConsumable(); ManufacturedProduct manufacturedProduct = CDAFactory.eINSTANCE.createManufacturedProduct(); Material material = CDAFactory.eINSTANCE.createMaterial(); CE materialCode = DatatypesFactory.eINSTANCE.createCE("C09BA03SETN000000010TABL", "2.16.756.5.30.2.6.2"); // set original text UNK materialCode .getTranslations() .add(DatatypesFactory.eINSTANCE.createCD("C09BA03", "2.16.840.1.113883.6.73", "", "")); material.setCode( DatatypesFactory.eINSTANCE.createCE("C09BA03SETN000000010TABL", "2.16.756.5.30.2.6.2")); EN name = DatatypesFactory.eINSTANCE.createEN(); name.addText("LISINOPRIL HCT Streuli Tabl 10/12.5 30 Stk"); material.setName(name); manufacturedProduct.setManufacturedMaterial(material); consumable.setManufacturedProduct(manufacturedProduct); substanceAdministration.setConsumable(consumable); medicationsSection.addSubstanceAdministration(substanceAdministration); clinicalDocument.addSection(medicationsSection); return ret; }