use of se.riv.clinicalprocess.healthcond.certificate.registerCertificate.v3.RegisterCertificateType in project webcert by sklintyg.
the class ListCertificatesForCareResponderStub method getIntyg.
private Intyg getIntyg(CertificateHolder certificate) {
String content = intygStore.getContentTemplate("minimal-rivta-content.xml").replace("CERTIFICATE_ID", certificate.getId()).replace("CERTIFICATE_TYPE", certificate.getType().toUpperCase()).replace("PATIENT_CRN", certificate.getCivicRegistrationNumber().getPersonnummer()).replace("CAREUNIT_ID", certificate.getCareUnitId()).replace("CAREUNIT_NAME", certificate.getCareUnitName()).replace("CAREGIVER_ID", certificate.getCareGiverId()).replace("DOCTOR_NAME", certificate.getSigningDoctorName()).replace("SIGNED_DATE", certificate.getSignedDate().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
RegisterCertificateType jaxbObject = JAXB.unmarshal(new StringReader(content), RegisterCertificateType.class);
return jaxbObject.getIntyg();
}
use of se.riv.clinicalprocess.healthcond.certificate.registerCertificate.v3.RegisterCertificateType in project webcert by sklintyg.
the class UtkastBootstrapBean method buildUtlatande.
// INTYG-4086: An incredibly ugly hack to mitigate the fact that we're populating test-data using the XML format
// and also directly to WC instead of storing in IT where these actually belong...
private Utlatande buildUtlatande(Resource resource, String moduleName) throws ModuleException, ModuleNotFoundException, IOException {
String xml = Resources.toString(resource.getURL(), Charsets.UTF_8);
Utlatande utlatande = registry.getModuleApi(moduleName).getUtlatandeFromXml(xml);
switch(moduleName) {
case "luse":
case "luae_fs":
case "luae_na":
case "lisjp":
RegisterCertificateType jaxbObject = JAXB.unmarshal(new StringReader(Resources.toString(resource.getURL(), Charsets.UTF_8)), RegisterCertificateType.class);
Patient patient = jaxbObject.getIntyg().getPatient();
utlatande.getGrundData().getPatient().setFornamn(patient.getFornamn());
utlatande.getGrundData().getPatient().setMellannamn(patient.getMellannamn());
utlatande.getGrundData().getPatient().setEfternamn(patient.getEfternamn());
utlatande.getGrundData().getPatient().setFullstandigtNamn(IntygConverterUtil.concatPatientName(patient.getFornamn(), patient.getMellannamn(), patient.getEfternamn()));
break;
case "fk7263":
RegisterMedicalCertificateType jaxbObject2 = JAXB.unmarshal(new StringReader(Resources.toString(resource.getURL(), Charsets.UTF_8)), RegisterMedicalCertificateType.class);
PatientType patient2 = jaxbObject2.getLakarutlatande().getPatient();
utlatande.getGrundData().getPatient().setEfternamn(patient2.getFullstandigtNamn());
utlatande.getGrundData().getPatient().setFullstandigtNamn(patient2.getFullstandigtNamn());
break;
case "ts-bas":
case "ts-diabetes":
break;
}
return utlatande;
}
Aggregations