Skip to content

Commit

Permalink
[26602] MedicationsDialog für Verrechnung und Dosierungsanweisung in …
Browse files Browse the repository at this point in the history
…der (#718)
  • Loading branch information
Daksic28 authored Sep 30, 2024
1 parent 6d31c2d commit 7ae53f3
Show file tree
Hide file tree
Showing 20 changed files with 563 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5110,6 +5110,15 @@ public class Messages extends NLS {
public static String LaborResultsComposite_documentSelectionErrorTitle;
public static String LaborResultsComposite_selectionLimitErrorMessage;
public static String LaborResultsComposite_selectionLimitErrorTitle;
public static String Medication_SettingsShowDialogOnBilling;
public static String VerrechnungsDisplay_deleteMedicationTitle;
public static String VerrechnungsDisplay_deleteMedicationMessage;
public static String VerrechnungsDisplay_deleteMedicationAll;
public static String VerrechnungsDisplay_deleteMedicationOnlyBilling;
public static String VerrechnungsDisplay_deleteMedicationCancel;
public static String ArticleDefaultSignatureComposite_Discharge;
public static String ArticleProcessorBilledWarningContext;
public static String ArticleProcessorBilledFail;
public static String Texterstellung_DiagnoseExportAlternativeFormat;
static { // load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,12 @@ ArticleDefaultSignatureComposite_dispensation = dispensation

ArticleDefaultSignatureComposite_fix = fix

ArticleDefaultSignatureComposite_Discharge = Discharge

ArticleProcessorBilledFail = Billing failed:\n

ArticleProcessorBilledWarningContext = Warning: The following services could not be billed in the current context (case, consultation, law):\n

ArticleDefaultSignatureComposite_noon = noon

ArticleDefaultSignatureComposite_onArticle = on article
Expand Down Expand Up @@ -6073,6 +6079,8 @@ MedicationSettings_ShowCustomSorting = Show custom sorting
MedicationSettings_EnablePredefinedSymptomDays = Enable predefined days for symptomatic medication
Medication_SettingsShowDialogOnBilling = Show medication dialog window during billing
MedicationSettings_NumberOfStopDays = Number of stop days for symptomatic medication
MedicationSettings_ShowCommentOnEMediplan = Display a comment on the eMediplan
Expand Down Expand Up @@ -9981,6 +9989,16 @@ VerrDetailDialog_detailsOfOpenKons = Abrechnungsdetails noch offener Behandlunge
VerrechnungsDisplay_AddItem = Verrechenbare Leistungen hinzuf\u00FCgen
VerrechnungsDisplay_deleteMedicationTitle = Delete Medication
VerrechnungsDisplay_deleteMedicationMessage = This entry is linked to a medication in the medication list. Do you want to delete the medication and the billing, only the billing, or do nothing?
VerrechnungsDisplay_deleteMedicationAll = Yes, delete everything
VerrechnungsDisplay_deleteMedicationOnlyBilling = No, only billing
VerrechnungsDisplay_deleteMedicationCancel = Cancel
VerrechnungsDisplay_Orininalpackungen = \ OP)
VerrechnungsDisplay_PositionCanootBeRemoved = position cam mot be removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ ArticleDefaultSignatureComposite_dispensation = Abgabe

ArticleDefaultSignatureComposite_fix = Fix

ArticleDefaultSignatureComposite_Discharge = Abgabe

ArticleDefaultSignatureComposite_noon = mittags

ArticleDefaultSignatureComposite_onArticle = auf Artikel hinterlegen
Expand All @@ -781,6 +783,10 @@ ArticleDefaultSignatureComposite_reserve = Reserve

ArticleDefaultSignatureComposite_sympomatic = Symptom

ArticleProcessorBilledFail = Verrechnung fehlgeschlagen:\n

ArticleProcessorBilledWarningContext = Warnung: Die folgenden Leistungen konnten im aktuellen Kontext (Fall, Konsultation, Gesetz) nicht verrechnet werden:\n

ArticleLabel_Name = Artikel-Etikette

ArticleSubTyp_ADDITIVE = Hilfsmittel
Expand Down Expand Up @@ -6051,6 +6057,8 @@ MedicationSettings_ShowCustomSorting = Pers\u00F6nliche Sortierung anzeigen

MedicationSettings_EnablePredefinedSymptomDays = Vordefinierte Tage f\u00FCr symptomatische Medikation aktivieren

Medication_SettingsShowDialogOnBilling = Medikations-Dialogfenster auch beim Verrechnen anzeigen

MedicationSettings_NumberOfStopDays = Anzahl Stop Tage f\u00FCr symptomatische Medikation

MedicationSettings_ShowCommentOnEMediplan = Eine Bemerkung auf dem eMediplan anzeigen
Expand Down Expand Up @@ -9971,6 +9979,16 @@ VerrechnungsDisplay_confirmChangeTextCaption = Wirklich Text \u00E4ndern?

VerrechnungsDisplay_doBill = Verrechnen

VerrechnungsDisplay_deleteMedicationTitle = Medikation l\u00F6schen

VerrechnungsDisplay_deleteMedicationMessage = Diese Position ist mit einer Medikation in der Medikationsliste verkn\u00FCpft. M\u00F6chten Sie die Medikation und die Verrechnung l\u00F6schen, nur die Verrechnung l\u00F6schen oder nichts l\u00F6schen?

VerrechnungsDisplay_deleteMedicationAll = Ja, alles l\u00F6schen

VerrechnungsDisplay_deleteMedicationOnlyBilling = Nein, nur Verrechnung

VerrechnungsDisplay_deleteMedicationCancel = Abbrechen

VerrechnungsDisplay_enterNewPrice = Geben Sie bitte den neuen Preis f\u00FCr die Leistung ein (x.xx oder -x%).

VerrechnungsDisplay_errorStartingCodeWindow = Fehler beim Starten des Leistungscodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ ArticleDefaultSignatureComposite_dispensation = delivery
ArticleDefaultSignatureComposite_fix = fix
ArticleDefaultSignatureComposite_Discharge = Discharge
ArticleDefaultSignatureComposite_noon = at lunchtime
ArticleDefaultSignatureComposite_onArticle = deposit on items
Expand All @@ -761,6 +763,10 @@ ArticleDefaultSignatureComposite_reserve = reserve
ArticleDefaultSignatureComposite_sympomatic = symptom
ArticleProcessorBilledFail = Billing failed:\n
ArticleProcessorBilledWarningContext = Warning: The following services could not be billed in the current context (case, consultation, law):\n
ArticleLabel_Name = Artikel-Etikette
ArticleSubTyp_ADDITIVE = additive
Expand Down Expand Up @@ -5991,6 +5997,8 @@ MedicationSettings_ShowCustomSorting = Show custom sorting
MedicationSettings_EnablePredefinedSymptomDays = Enable predefined days for symptomatic medication
Medication_SettingsShowDialogOnBilling = Show medication dialog window during billing
MedicationSettings_NumberOfStopDays = Number of stop days for symptomatic medication
MedicationSettings_ShowCommentOnEMediplan = Display a comment on the eMediplan
Expand Down Expand Up @@ -9821,6 +9829,16 @@ VerrDetailDialog_detailsOfOpenKons = Billing details of open treatments

VerrechnungsDisplay_AddItem = Add chargeable services

VerrechnungsDisplay_deleteMedicationTitle = Delete Medication

VerrechnungsDisplay_deleteMedicationMessage = This entry is linked to a medication in the medication list. Do you want to delete the medication and the billing, only the billing, or do nothing?

VerrechnungsDisplay_deleteMedicationAll = Yes, delete everything

VerrechnungsDisplay_deleteMedicationOnlyBilling = No, only billing

VerrechnungsDisplay_deleteMedicationCancel = Cancel

VerrechnungsDisplay_Orininalpackungen = \ OP)

VerrechnungsDisplay_PositionCanootBeRemoved = Service item can not be removed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ ArticleDefaultSignatureComposite_dispensation = Livraison

ArticleDefaultSignatureComposite_fix = Fixer

ArticleDefaultSignatureComposite_Discharge = Remise

ArticleDefaultSignatureComposite_noon = \u00E0 midi

ArticleDefaultSignatureComposite_onArticle = d\u00E9p\u00F4t article
Expand All @@ -761,6 +763,10 @@ ArticleDefaultSignatureComposite_reserve = R\u00E9serve

ArticleDefaultSignatureComposite_sympomatic = Sympt\u00F4me

ArticleProcessorBilledFail = Facturation \u00E9chou\u00E9e:\n

ArticleProcessorBilledWarningContext = Avertissement : Les services suivants n\u2019ont pas pu \u00EAtre factur\u00E9s dans le contexte actuel (cas, consultation, loi) :\n

ArticleLabel_Name = Artikel-Etiquette

ArticleSubTyp_ADDITIVE = Agent auxiliaire
Expand Down Expand Up @@ -5987,6 +5993,8 @@ MedicationSettings_ShowCustomSorting = Afficher le tri personnalis\u00E9

MedicationSettings_EnablePredefinedSymptomDays = Activer les jours pr\u00E9d\u00E9finis pour la m\u00E9dication symptomatique

Medication_SettingsShowDialogOnBilling = Afficher la fen\u00EAtre de dialogue de m\u00E9dication lors de la facturation

MedicationSettings_NumberOfStopDays = Nombre de jours d'arr\u00EAt pour la m\u00E9dication symptomatique
MedicationSettings_ShowCommentOnEMediplan = Afficher une remarque sur l'eMediplan
Expand Down Expand Up @@ -9741,6 +9749,16 @@ VerrDetailDialog_detailsOfOpenKons = D\u00E9tails de la facturation des traiteme

VerrechnungsDisplay_AddItem = Ajouter une prestation payante

VerrechnungsDisplay_deleteMedicationTitle = Supprimer la m\u00E9dication

VerrechnungsDisplay_deleteMedicationMessage = Cet \u00E9l\u00E9ment est li\u00E9 \u00E0 une m\u00E9dication dans la liste des m\u00E9dications. Voulez-vous supprimer la m\u00E9dication et la facturation, seulement la facturation ou ne rien supprimer?

VerrechnungsDisplay_deleteMedicationAll = Oui, tout supprimer

VerrechnungsDisplay_deleteMedicationOnlyBilling = Non, seulement la facturation

VerrechnungsDisplay_deleteMedicationCancel = Annuler

VerrechnungsDisplay_Orininalpackungen = \ OP)

VerrechnungsDisplay_PositionCanootBeRemoved = Position de puissance ne peut pas \u00EAtre supprim\u00E9.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ ArticleDefaultSignatureComposite_dispensation = Consegna
ArticleDefaultSignatureComposite_fix = Fissare
ArticleDefaultSignatureComposite_Discharge = Consegna
ArticleDefaultSignatureComposite_noon = all'ora di pranzo

ArticleDefaultSignatureComposite_onArticle = deposito Articolo
Expand All @@ -761,6 +763,10 @@ ArticleDefaultSignatureComposite_reserve = Riserva

ArticleDefaultSignatureComposite_sympomatic = Sintomo

ArticleProcessorBilledFail = Fatturazione fallita:\n

ArticleProcessorBilledWarningContext = Avviso: I seguenti servizi non possono essere fatturati nel contesto attuale (caso, consultazione, legge):\n

ArticleLabel_Name = Artikel-Etikette

ArticleSubTyp_ADDITIVE = aiuto
Expand Down Expand Up @@ -5989,6 +5995,8 @@ MedicationSettings_ShowCustomSorting = Mostra l'ordinamento personalizzato

MedicationSettings_EnablePredefinedSymptomDays = Abilita giorni predefiniti per la medicazione sintomatica

Medication_SettingsShowDialogOnBilling = Mostra la finestra di dialogo della medicazione durante la fatturazione

MedicationSettings_NumberOfStopDays = Numero di giorni di sospensione per la medicazione sintomatica

MedicationSettings_ShowCommentOnEMediplan = Mostra un commento sull'eMediplan
Expand Down Expand Up @@ -9743,6 +9751,16 @@ VerrDetailDialog_detailsOfOpenKons = Fatturazione dettagli di trattamenti eccezi
VerrechnungsDisplay_AddItem = Aggiungi prestazioni a pagamento
VerrechnungsDisplay_deleteMedicationTitle = Eliminare la medicazione
VerrechnungsDisplay_deleteMedicationMessage = Questa voce \u00E8 collegata a una medicazione nell'elenco delle medicazioni. Vuoi eliminare la medicazione e la fatturazione, solo la fatturazione o non eliminare nulla?
VerrechnungsDisplay_deleteMedicationAll = S\u00EC, elimina tutto
VerrechnungsDisplay_deleteMedicationOnlyBilling = No, solo fatturazione
VerrechnungsDisplay_deleteMedicationCancel = Annulla
VerrechnungsDisplay_Orininalpackungen = \ OP)
VerrechnungsDisplay_PositionCanootBeRemoved = Posizione di potere non pu\u00F2 essere rimosso.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ public IPrescription createPrescriptionCopy(IPrescription prescription) {
ret.setDisposalComment(prescription.getDisposalComment());
ret.setEntryType(prescription.getEntryType());
ret.setRemark(prescription.getRemark());

String extInfoValue = prescription.getExtInfo(ch.elexis.core.model.prescription.Constants.FLD_EXT_VERRECHNET_ID)
.toString();
if (extInfoValue != null && !extInfoValue.isEmpty()) {
ret.setExtInfo(ch.elexis.core.model.prescription.Constants.FLD_EXT_VERRECHNET_ID, extInfoValue);
}
ret.setDateFrom(LocalDateTime.now());
ret.setPrescriptor(ContextServiceHolder.get().getActiveUserContact().orElse(null));
return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,8 @@ public void run() {
Optional<IPatient> patientOpt = getPatient(billed);
Optional<String> articleStoreToString = StoreToStringServiceHolder.get().storeToString(article);
if (patientOpt.isPresent() && articleStoreToString.isPresent()) {
// lookup existing prescriptions
IQuery<IPrescription> query = CoreModelServiceHolder.get().getQuery(IPrescription.class);
query.and(ModelPackage.Literals.IPRESCRIPTION__PATIENT, COMPARATOR.EQUALS, patientOpt.get());
query.and("artikel", COMPARATOR.EQUALS, articleStoreToString.get()); //$NON-NLS-1$
query.orderBy(ModelPackage.Literals.IPRESCRIPTION__DATE_FROM, ORDER.DESC);
List<IPrescription> existingPrescriptions = query.execute();

// create new dispensation
boolean dispensationExists = false;
if (!existingPrescriptions.isEmpty()) {
// only create new dispensation if no dispensation on the same day
for (IPrescription prescription : existingPrescriptions) {
if (prescription.getEntryType() == EntryType.SELF_DISPENSED) {
LocalDateTime prescriptionDate = prescription.getDateFrom();
LocalDateTime billedDate = getBilledDateTime(billed);
if (prescriptionDate.toLocalDate().equals(billedDate.toLocalDate())) {
dispensationExists = true;
break;
}
}
}
}
if (!dispensationExists) {
createDispensationPrescription(article, patientOpt.get(), billed);
ContextServiceHolder.get().postEvent(ElexisEventTopics.EVENT_RELOAD, IPrescription.class);
}
}
}
}
Expand All @@ -87,18 +63,13 @@ private Optional<IPatient> getPatient(IBilled billed) {
return Optional.empty();
}

private LocalDateTime getBilledDateTime(IBilled billed) {
IEncounter encounter = billed.getEncounter();
return encounter.getTimeStamp();
}

private IPrescription createDispensationPrescription(IArticle article, IPatient patient, IBilled billed) {
IPrescription prescription = new IPrescriptionBuilder(CoreModelServiceHolder.get(), ContextServiceHolder.get(),
article, patient, StringUtils.EMPTY).build();
prescription.setExtInfo(ch.elexis.core.model.prescription.Constants.FLD_EXT_VERRECHNET_ID, billed.getId());
billed.setExtInfo(ch.elexis.core.model.verrechnet.Constants.FLD_EXT_PRESC_ID, prescription.getId());
prescription.setEntryType(EntryType.SELF_DISPENSED);
prescription.setDateTo(LocalDateTime.now());
prescription.setDateFrom(billed.getEncounter().getDate().atStartOfDay());
CoreModelServiceHolder.get().save(prescription);
return prescription;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ protected void createFieldEditors() {
addField(sortingFieldEditor);
addField(new BooleanFieldEditor(Preferences.USR_SUPPRESS_INTERACTION_CHECK,
ch.elexis.core.l10n.Messages.UserSettings2_SuppressInteractionCheck, getFieldEditorParent()));
addField(new BooleanFieldEditor(Preferences.MEDICATION_SETTINGS_SHOW_DIALOG_ON_BILLING,
ch.elexis.core.l10n.Messages.Medication_SettingsShowDialogOnBilling,
getFieldEditorParent()));
predefinedSymptomDaysFieldEditor = new BooleanFieldEditor(Preferences.MEDICATION_SETTINGS_DEFAULT_SYMPTOMS,
ch.elexis.core.l10n.Messages.MedicationSettings_EnablePredefinedSymptomDays, getFieldEditorParent());
addField(predefinedSymptomDaysFieldEditor);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ch.elexis.core.ui.medication.views;


import javax.inject.Inject;
import javax.inject.Named;

Expand Down Expand Up @@ -61,6 +62,18 @@ void udpatePatient(@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) IPatient patien
}
}

@Inject
@Optional
public void reload(@UIEventTopic(ElexisEventTopics.EVENT_RELOAD) Class<?> clazz) {
if (IPrescription.class.equals(clazz)) {
if (CoreUiUtil.isActiveControl(tpc)) {
Display.getDefault().asyncExec(() -> {
updateUi(ContextServiceHolder.get().getActivePatient().orElse(null), true);
});
}
}
}

@Optional
@Inject
void updatePrescription(@UIEventTopic(ElexisEventTopics.EVENT_UPDATE) IPrescription prescription) {
Expand Down
1 change: 1 addition & 0 deletions bundles/ch.elexis.core.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Export-Package: ch.elexis.core.ui,
ch.elexis.core.ui.locks,
ch.elexis.core.ui.preferences,
ch.elexis.core.ui.preferences.inputs,
ch.elexis.core.ui.processor,
ch.elexis.core.ui.proposals,
ch.elexis.core.ui.selectors,
ch.elexis.core.ui.services,
Expand Down
2 changes: 2 additions & 0 deletions bundles/ch.elexis.core.ui/src/ch/elexis/core/ui/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ public class Messages {
public static String Hub_title_configuration = ch.elexis.core.l10n.Messages.Hub_title_configuration;
public static String Core_Not_logged_in = ch.elexis.core.l10n.Messages.Core_Not_logged_in;
public static String Core_Please_Enter_Name_and_Password = ch.elexis.core.l10n.Messages.Core_Please_Enter_Name_and_Password;
public static String ArticleProcessorBilledWarningContext = ch.elexis.core.l10n.Messages.ArticleProcessorBilledWarningContext;
public static String ArticleProcessorBilledFail = ch.elexis.core.l10n.Messages.ArticleProcessorBilledFail;

};
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ public class ExtensionPointConstantsUi {
public static final String RECHNUNGSDETAIL = "ch.elexis.core.ui.Rechnungsdetail"; //$NON-NLS-1$
public static final String TEXT_TEMPLATE_REQUIREMENT = "ch.elexis.core.ui.TextTemplateRequirement"; //$NON-NLS-1$
public static final String ACCESSCONTROL = "ch.elexis.core.ui.AccessControl"; //$NON-NLS-1$
public static final String PAYLOAD_ARTICLE = "article"; //$NON-NLS-1$
public static final String PAYLOAD_SIGNATURE = "signature"; //$NON-NLS-1$
public static final String PAYLOAD_BILLED = "billed"; //$NON-NLS-1$
}
Loading

0 comments on commit 7ae53f3

Please sign in to comment.