===================== API / Casemaster ===================== .. contents:: :depth: 2 :local: :backlinks: none .. highlight:: java Usage ------- .. code-block:: java import ch.oaat_otma.casemaster.Casemaster; import ch.oaat_otma.casemaster.CasemasterResult; import ch.oaat_otma.casemaster.Patient; import ch.oaat_otma.casemaster.Session; import ch.oaat_otma.Diagnosis; import ch.oaat_otma.PatientCase; import ch.oaat_otma.Service; /** * 1. Create a Casemaster instance with a JSON file containing the * classification system assigning the Capitulum for a specific version of the * OAAT flat rates */ Casemaster cm = new Casemaster(new File("path/to/oaat-files/system_ambP_XX_cap_assignment.json")); /** * 2. Create a sample patient with sessions and services. * The services are coded with LKAAT codes. * This sample case contains two sessions with diagnoses grouping into different Capitula. */ List sessions = new ArrayList<>(); Session s1 = new Session(1, LocalDate.now()); Session s2 = new Session(2, LocalDate.now()); sessions.add(s1); sessions.add(s2); /** Cap 08 */ s1.setDiagnosis(new Diagnosis("A54.4")); /** Cap 06 */ s2.setDiagnosis(new Diagnosis("N80.5")); s1.addService(new Service("AA.00.0010")); s1.addService(new Service("AA.00.0020")); /** C06.CB.0010 is a trigger code. */ s2.addService(new Service("C06.CB.0010")); Patient p = new Patient(); p.setSessions(sessions); /** * 3. Apply the Casemaster to the patient. */ CasemasterResult cr = cm.apply(p); /** * 4. results contain errors and generated patient case / outpatient treatments * (ambulante Behandlungen) */ cr.errors.forEach(System.out::println); cr.patientCases.forEach(System.out::println); Casemaster Results ------------------- The CasemasterResult class encapsulates the result of a Casemaster operation. It contains two main fields: * **patientCases**: A list of generated patient cases / outpatient treatments which can then be used in the grouper and then the mapper. * **errors**: A list of errors that occurred during the Casemaster process. The errors are of type CasemasterError which contains an error message the associated session and the type of error: .. code-block:: java /** * The diagnosis is missing or invalid (Tessinercode or invalid ICD-10 code) and * the session is on a day where an ICD diagnosis is required (trigger position present). * This session will not be processed and should be corrected. */ MISSING_OR_INVALID_DIAGNOSIS, /** * Paramedicine or transportation tariffs should not be in the same session as a * medical service (LKAAT). */ PARAMEDICINE_TRANSPORTATION_WITH_MEDICAL_SERVICE, /** * The session contains a radiation planning service that can not be assigned to * a radiation therapy. This session will not be processed and should be corrected. */ UNASSIGNABLE_RADIATION_PLANNING