use of se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType 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.inera.ifv.insuranceprocess.healthreporting.v2.PatientType in project webcert by sklintyg.
the class QuestionAnswerValidator method validate.
public static List<String> validate(ReceiveMedicalCertificateQuestionType request) {
List<String> messages = new ArrayList<>();
if (request.getQuestion().getFraga() == null) {
messages.add("Missing fraga element.");
}
validateAmne(messages, request.getQuestion().getAmne());
LakarutlatandeEnkelType lakarutlatande = request.getQuestion().getLakarutlatande();
validateLakarutlatande(messages, lakarutlatande);
HosPersonalType hosPersonal = request.getQuestion().getAdressVard().getHosPersonal();
validateHosPersonal(messages, hosPersonal);
validateEnhet(messages, hosPersonal);
validateVardgivare(messages, hosPersonal);
PatientType patient = lakarutlatande.getPatient();
validatePatient(messages, patient);
return messages;
}
use of se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType in project webcert by sklintyg.
the class QuestionAnswerValidator method validate.
public static List<String> validate(ReceiveMedicalCertificateAnswerType request) {
List<String> messages = new ArrayList<>();
if (request.getAnswer().getSvar() == null) {
messages.add("Missing svar element.");
}
validateAmne(messages, request.getAnswer().getAmne());
LakarutlatandeEnkelType lakarutlatande = request.getAnswer().getLakarutlatande();
validateLakarutlatande(messages, lakarutlatande);
HosPersonalType hosPersonal = request.getAnswer().getAdressVard().getHosPersonal();
validateHosPersonal(messages, hosPersonal);
validateEnhet(messages, hosPersonal);
validateVardgivare(messages, hosPersonal);
PatientType patient = lakarutlatande.getPatient();
validatePatient(messages, patient);
return messages;
}
use of se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType in project webcert by sklintyg.
the class ConvertToFKTypes method toLakarUtlatande.
public static LakarutlatandeEnkelType toLakarUtlatande(IntygsReferens ir) {
if (ir == null) {
return null;
}
LakarutlatandeEnkelType lu = new LakarutlatandeEnkelType();
lu.setLakarutlatandeId(ir.getIntygsId());
PatientType pt = new PatientType();
String root = PERSON_ID_OID;
if (SamordningsnummerValidator.isSamordningsNummer(Optional.ofNullable(ir.getPatientId()))) {
root = SAMORDNING_ID_OID;
}
pt.setPersonId(toII(root, ir.getPatientId().getPersonnummerWithDash()));
lu.setPatient(pt);
lu.setSigneringsTidpunkt(ir.getSigneringsDatum());
return lu;
}
Aggregations