===================== API / Mapper ===================== .. contents:: :depth: 2 :local: :backlinks: none .. highlight:: java Usage ------- :: import ch.oaat_otma.mapper.Mapper; import ch.oaat_otma.mapper.MapperResult; import ch.oaat_otma.mapper.ServiceCatalog; import ch.oaat_otma.mapper.TardocCatalog; import ch.oaat_otma.PatientCase; import ch.oaat_otma.Service; /* 1. Read the service and TARDOC catalogs from JSON files. */ File tardocCatalogFile = new File("path/to/oaat-files/tardoc_ZZ_de.json"); TardocCatalog tardocCatalog = TardocCatalog.readCatalog(tardocCatalogFile); File serviceCatalogFile = new File("path/to/oaat-files/lkaat_YY.json"); ServiceCatalog serviceCatalog = ServiceCatalog.readCatalog(serviceCatalogFile); /* 2. Create a Mapper instance and map a patient case. */ Mapper mapper = new Mapper(serviceCatalog, tardocCatalog); PatientCase patientCase = new PatientCase(); patientCase.addService(new Service("AA.00.0010", Side.NONE, 1, LocalDate.now(), 1)); MapperResult result = mapper.map(patientCase); /** * 3. Optional: annotate resulting TARDOC tarpos with their billable amount. * Note: Percentage services (Prozentleistungen) are not calculated. */ double tpw = 0.89; tardocCatalog.calculateAmount(patientCase, tpw); Mapper Results ---------------- The MapperResult class is designed to encapsulate the result of a mapping operation. It contains three main fields: * **patientCase**: An instance of PatientCase that holds the patient data along with the resulting TARDOC tarpos. * **addedTarpos**: An immutable list of Tarpo objects that were added to the patientCase during the mapping operation. * **log**: An immutable list of MapperLogEntry objects that record information, warnings, and errors encountered during the mapping process. a log entry has e log level of the enum type MapperLogEntryLevel and can be mapped to a specific Tarpo or Service object using the corresponding codes and session number.