use of se.riv.clinicalprocess.healthcond.certificate.v3.Patient 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;
}
use of se.riv.clinicalprocess.healthcond.certificate.v3.Patient in project webcert by sklintyg.
the class CertificateStatusUpdateForCareResponderStub method certificateStatusUpdateForCare.
@Override
public CertificateStatusUpdateForCareResponseType certificateStatusUpdateForCare(String logicalAddress, CertificateStatusUpdateForCareType request) {
Intyg intyg = request.getIntyg();
String handelseKod = request.getHandelse().getHandelsekod().getCode();
String intygsId = intyg.getIntygsId().getExtension();
StringBuilder sb = new StringBuilder();
if (intyg.getSigneringstidpunkt() != null) {
sb.append(" Signeringstidpunkt: " + intyg.getSigneringstidpunkt());
sb.append("\n");
}
if (intyg.getPatient() != null) {
sb.append(" Patient: " + intyg.getPatient().getPersonId().getExtension());
sb.append("\n");
}
Arenden skickadeFragor = request.getSkickadeFragor();
sb.append(" Skickade fragor totalt: " + skickadeFragor.getTotalt());
sb.append(" Skickade fragor hanterade: " + skickadeFragor.getHanterade());
sb.append(" Skickade fragor besvarade: " + skickadeFragor.getBesvarade());
sb.append(" Skickade fragor ej besvarade: " + skickadeFragor.getEjBesvarade());
sb.append("\n");
Arenden mottagnaFragor = request.getMottagnaFragor();
sb.append(" Mottagna fragor totalt: " + mottagnaFragor.getTotalt());
sb.append(" Mottagna fragor hanterade: " + mottagnaFragor.getHanterade());
sb.append(" Mottagna fragor besvarade: " + mottagnaFragor.getBesvarade());
sb.append(" Mottagna fragor ej besvarade: " + mottagnaFragor.getEjBesvarade());
sb.append("\n");
LOG.info("\n*********************************************************************************\n" + " Request to address '{}' recieved for intyg: {} handelse: {}.\n" + "{}" + "*********************************************************************************", logicalAddress, intygsId, handelseKod, sb.toString());
notificationStoreV3.put(request);
CertificateStatusUpdateForCareResponseType response = new CertificateStatusUpdateForCareResponseType();
response.setResult(ResultTypeUtil.okResult());
LOG.debug("Request set to 'OK'");
return response;
}
use of se.riv.clinicalprocess.healthcond.certificate.v3.Patient in project webcert by sklintyg.
the class NotificationTestHelper method buildPatient.
public static Patient buildPatient() {
PersonId personId = new PersonId();
personId.setExtension(PERSNR);
Patient patient = new Patient();
patient.setPersonId(personId);
patient.setFornamn("");
patient.setMellannamn("");
patient.setEfternamn("");
patient.setPostadress("");
patient.setPostnummer("");
patient.setPostort("");
return patient;
}
use of se.riv.clinicalprocess.healthcond.certificate.v3.Patient in project webcert by sklintyg.
the class CreateNewDraftRequestBuilderTest method createUtlatande.
private Utlatande createUtlatande() {
Utlatande utlatande = new Utlatande();
// Type
TypAvUtlatande utlTyp = new TypAvUtlatande();
utlTyp.setCode(CERT_TYPE);
utlatande.setTypAvUtlatande(utlTyp);
// HoSPerson
HsaId userHsaId = new HsaId();
userHsaId.setExtension(USER_HSAID);
userHsaId.setRoot("USERHSAID");
HosPersonal hosPerson = new HosPersonal();
hosPerson.setPersonalId(userHsaId);
hosPerson.setFullstandigtNamn(FULLSTANDIGT_NAMN);
HsaId unitHsaId = new HsaId();
unitHsaId.setExtension(UNIT_HSAID);
unitHsaId.setRoot("UNITHSAID");
Enhet hosEnhet = new Enhet();
hosEnhet.setEnhetsId(unitHsaId);
hosPerson.setEnhet(hosEnhet);
utlatande.setSkapadAv(hosPerson);
// Patient
PersonId personId = new PersonId();
personId.setRoot("PERSNR");
personId.setExtension(PERSNR);
Patient patType = new Patient();
patType.setPersonId(personId);
patType.getFornamn().add("Adam");
patType.getFornamn().add("Bertil");
patType.getMellannamn().add("Cesarsson");
patType.getMellannamn().add("Davidsson");
patType.setEfternamn("Eriksson");
utlatande.setPatient(patType);
return utlatande;
}
use of se.riv.clinicalprocess.healthcond.certificate.v3.Patient in project webcert by sklintyg.
the class CreateNewDraftRequestBuilderTest method createIntyg.
private Intyg createIntyg() {
Intyg intyg = new Intyg();
TypAvIntyg intygTyp = new TypAvIntyg();
intygTyp.setCode(CERT_TYPE);
intyg.setTypAvIntyg(intygTyp);
HosPersonal hosPerson = new HosPersonal();
HsaId userHsaId = new HsaId();
userHsaId.setExtension(USER_HSAID);
userHsaId.setRoot("USERHSAID");
hosPerson.setPersonalId(userHsaId);
hosPerson.setFullstandigtNamn(FULLSTANDIGT_NAMN);
Enhet hosEnhet = new Enhet();
HsaId unitHsaId = new HsaId();
unitHsaId.setExtension(UNIT_HSAID);
unitHsaId.setRoot("UNITHSAID");
hosEnhet.setEnhetsId(unitHsaId);
hosPerson.setEnhet(hosEnhet);
intyg.setSkapadAv(hosPerson);
Patient patType = new Patient();
PersonId personId = new PersonId();
personId.setRoot("PERSNR");
personId.setExtension(PERSONNUMMER);
patType.setPersonId(personId);
patType.setFornamn(FORNAMN);
patType.setMellannamn(MELLANNAMN);
patType.setEfternamn(EFTERNAMN);
patType.setPostadress(PATIENT_POSTADRESS);
patType.setPostnummer(PATIENT_POSTNUMMER);
patType.setPostort(PATIENT_POSTORT);
intyg.setPatient(patType);
return intyg;
}
Aggregations