Skip to content

Commit

Permalink
[26587] publish patient questionnaire (#711)
Browse files Browse the repository at this point in the history
Co-authored-by: pdenzler <[email protected]>
  • Loading branch information
PatrickDenzler and pdenzler authored Sep 4, 2024
1 parent 19615b1 commit a89de09
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 14 deletions.
12 changes: 12 additions & 0 deletions bundles/ch.elexis.core.l10n/src/ch/elexis/core/l10n/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,7 @@ public class Messages extends NLS {
public static String Core_the_description;
public static String Core_today;
public static String Core_undefined;
public static String Core_loading;
public static String Corr_No;
public static String CreateChart;
public static String CreateLicenseJob_Creating;
Expand Down Expand Up @@ -2994,6 +2995,17 @@ public class Messages extends NLS {
public static String Mediorder_requested_Tooltip;
public static String Mediorder_approved;
public static String Mediorder_approved_Tooltip;
public static String Mediorder_unequal;
public static String Mediorder_comparison;
public static String Mediorder_comparison_Tooltip;
public static String Mediorder_updateArticle;
public static String Mediorder_updateArticle_successful;
public static String Mediorder_updateArticle_error;
public static String Mediorder_activate_patient_order;
public static String Mediroder_missing_email;
public static String Mediorder_missing_email_message;
public static String Mediorder_signed_decleration_of_consent;
public static String Mediorder_signed_decleration_of_consent_message;
public static String MedicsPreferencePage_defaultMedicsUrl;
public static String MedicsPreferencePage_documentCategoryName;
public static String MedicsPreferencePage_labelUploadDirimed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2357,6 +2357,8 @@ Core_today = heute

Core_undefined = undefiniert

Core_loading = Loading...

Corr_No = Nein

CreateChart = Create Chart
Expand Down Expand Up @@ -6081,6 +6083,28 @@ Mediorder_approved = Approved
Mediorder_approved_Tooltip = Amount approved for ordering
Mediorder_unequal = unequal
Mediorder_comparison = comparison
Mediorder_comparison_Tooltip = Comparison of the items approved with the items in the web app
Mediorder_updateArticle = Articles have been successfully updated
Mediorder_updateArticle_successful = Successful
Mediorder_updateArticle_error = error
Mediorder_activate_patient_order = Activate patient order via pea
Mediroder_missing_email = missing e-mail
Mediorder_missing_email_message = Patient has no e-mail. \nA valid e-mail address is required to order medication
Mediorder_signed_decleration_of_consent = Signed declaration of consent
Mediorder_signed_decleration_of_consent_message = Has the patient signed the consent form?
MedicsPreferencePage_defaultMedicsUrl = http://www.medics-labor.ch/
MedicsPreferencePage_documentCategoryName = Medics Laborbefunde
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,8 @@ Core_today = heute

Core_undefined = undefiniert

Core_loading = Laden...

Corr_No = Nein

CreateChart = Diagramme erstellen
Expand Down Expand Up @@ -6059,6 +6061,28 @@ Mediorder_approved = Freigegeben

Mediorder_approved_Tooltip = Zur Bestellung freigegebene Menge

Mediorder_unequal = Ungleich

Mediorder_comparison = Abgleich

Mediorder_comparison_Tooltip = Abgleich der freigegebenen Artikel mit den Artikeln in der Web-App

Mediorder_updateArticle = Artikel wurden erfolgreich aktualisiert

Mediorder_updateArticle_successful = Erfolgreich

Mediorder_updateArticle_error = Fehlgeschlagen

Mediorder_activate_patient_order = Patientenbestellung \u00FCber PEA aktivieren

Mediroder_missing_email = Fehlende E-Mail

Mediorder_missing_email_message = Patient hat keine E-Mail hinterlegt. \nF\u00FCr die Medikamentenbestellung wird eine g\u00FCltige E-Mail-Adresse ben\u00F6tig

Mediorder_signed_decleration_of_consent = Einverst\u00E4ndniserkl\u00E4rung unterschrieben

Mediorder_signed_decleration_of_consent_message = Hat der Patient die Einverst\u00E4ndniserkl\u00E4rung unterschrieben?

MedicsPreferencePage_defaultMedicsUrl = http://www.medics-labor.ch/

MedicsPreferencePage_documentCategoryName = Medics Laborbefunde
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2297,6 +2297,8 @@ Core_today = today
Core_undefined = undefined
Core_loading = Loading...
Corr_No = No
CreateChart = Create Chart
Expand Down Expand Up @@ -5999,6 +6001,28 @@ Mediorder_approved = Approved
Mediorder_approved_Tooltip = Amount approved for ordering
Mediorder_unequal = unequal
Mediorder_comparison = comparison
Mediorder_comparison_Tooltip = Comparison of the items approved with the items in the web app
Mediorder_updateArticle = Articles have been successfully updated
Mediorder_updateArticle_successful = Successful
Mediorder_updateArticle_error = error
Mediorder_activate_patient_order = Activate patient order via pea
Mediroder_missing_email = missing e-mail
Mediorder_missing_email_message = Patient has no e-mail. \nA valid e-mail address is required to order medication
Mediorder_signed_decleration_of_consent = Signed declaration of consent
Mediorder_signed_decleration_of_consent_message = Has the patient signed the consent form?
MedicsPreferencePage_defaultMedicsUrl = http://www.medics-labor.ch/
MedicsPreferencePage_documentCategoryName = Medics laboratory findings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,8 @@ Core_today = aujourd'hui
Core_undefined = ind\u00E9fini
Core_loading = charger...
Corr_No = Non
CreateChart = Cr\u00E9er graphique
Expand Down Expand Up @@ -5995,6 +5997,28 @@ Mediorder_approved = Lib

Mediorder_approved_Tooltip = Quantité libérée pour commande

Mediorder_unequal = inégal

Mediorder_comparison = comparaison

Mediorder_comparison_Tooltip = Comparaison des éléments approuvés avec les éléments dans l'application web
Mediorder_updateArticle = Les articles ont été mis à jour avec succès
Mediorder_updateArticle_successful = avec succès
Mediorder_updateArticle_error = échoué
Mediorder_activate_patient_order = Activer la commande des patients via PEA
Mediroder_missing_email = E-mail manquante
Mediorder_missing_email_message = Le patient n'a pas fourni d'adresse e-mail. \nUne adresse e-mail valide est nécessaire pour la commande de médicaments.
Mediorder_signed_decleration_of_consent = Consentement signé
Mediorder_signed_decleration_of_consent_message = Le patient a-t-il signé le consentement?
MedicsPreferencePage_defaultMedicsUrl = http://www.medics-labor.ch/
MedicsPreferencePage_documentCategoryName = les r\u00E9sultats de laboratoire Medics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,8 @@ Core_today = oggi

Core_undefined = non definito

Core_loading = caricare...

Corr_No = No

CreateChart = Crea grafico
Expand Down Expand Up @@ -5997,6 +5999,28 @@ Mediorder_approved = Rilasciato

Mediorder_approved_Tooltip = Quantità rilasciata per l'ordine
Mediorder_unequal = disuguale
Mediorder_comparison = confronto
Mediorder_comparison_Tooltip = Confronto degli elementi approvati con gli elementi nell'app web

Mediorder_updateArticle = Gli articoli sono stati aggiornati con successo

Mediorder_updateArticle_successful = con successo

Mediorder_updateArticle_error = fallito

Mediorder_activate_patient_order = Attivare l'ordine dei pazienti tramite PEA
Mediroder_missing_email = Email mancante
Mediorder_missing_email_message = Il paziente non ha fornito un'email. \nPer l'ordine dei farmaci è necessario un indirizzo email valido
Mediorder_signed_decleration_of_consent = Consenso informato firmato
Mediorder_signed_decleration_of_consent_message = Il paziente ha firmato il consenso informato?
MedicsPreferencePage_defaultMedicsUrl = http://www.medics-labor.ch/
MedicsPreferencePage_documentCategoryName = risultati di laboratorio Medics
Expand Down
3 changes: 2 additions & 1 deletion bundles/ch.elexis.core.ui.mediorder/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Bundle-Name: Patient Mediorder
Bundle-SymbolicName: ch.elexis.core.ui.mediorder;singleton:=true
Bundle-Vendor: ch.elexis
Bundle-Version: 3.13.0.qualifier
Import-Package: javax.inject;version="1.0.0"
Import-Package: ch.elexis.core.ui.views.contribution,
javax.inject;version="1.0.0"
Require-Bundle: ch.elexis.core.ui.e4;bundle-version="3.12.0",
org.eclipse.e4.core.di,
ch.elexis.core.ui.icons;bundle-version="3.12.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.EditingSupport;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
Expand Down Expand Up @@ -63,6 +62,7 @@
import ch.elexis.core.ui.e4.dnd.GenericObjectDropTarget;
import ch.elexis.core.ui.e4.parts.IRefreshablePart;
import ch.elexis.core.ui.icons.Images;
import ch.elexis.core.ui.views.contribution.IViewContribution;

public class MediorderPart implements IRefreshablePart {

Expand Down Expand Up @@ -91,6 +91,9 @@ public class MediorderPart implements IRefreshablePart {
@Inject
IMedicationService medicationService;

@Inject
private IViewContribution contribution;

private TableViewer tableViewer;
private TableViewer tableViewerDetails;

Expand All @@ -101,6 +104,7 @@ public class MediorderPart implements IRefreshablePart {
private WritableValue<IStock> selectedDetailStock;

private Map<IStock, Integer> imageStockStates = new HashMap<IStock, Integer>();


public MediorderPart() {
dateFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");
Expand Down Expand Up @@ -153,11 +157,6 @@ private void createPatientorderListViewer(Composite parent) {
table.setHeaderVisible(true);
tableViewer.setContentProvider(ArrayContentProvider.getInstance());
tableViewer.setComparator(stockComparator);
tableViewer.addSelectionChangedListener((SelectionChangedEvent event) -> {
IStructuredSelection selection = event.getStructuredSelection();
selectedDetailStock.setValue((IStock) selection.getFirstElement());
});

// order status
TableViewerColumn tvcOrderState = new TableViewerColumn(tableViewer, SWT.NONE);
tvcOrderState.setLabelProvider(new ColumnLabelProvider() {
Expand All @@ -167,6 +166,8 @@ public Image getImage(Object element) {
IStock stock = (IStock) element;
int number = getImageForStock(stock);
return switch (number) {
// Represent an inactive order in PEA
case 0 -> Images.IMG_BULLET_GREY.getImage();
case 1 -> Images.IMG_BULLET_GREEN.getImage();
case 2 -> Images.IMG_BULLET_YELLOW.getImage();
case 3 -> Images.IMG_BULLET_BLUE.getImage();
Expand Down Expand Up @@ -261,6 +262,8 @@ public void widgetSelected(SelectionEvent e) {
}
});

cStockTable.setData("tableViewer", tableViewer);
contribution.initComposite(cStockTable);
}

private void createPatientorderDetailViewer(Composite parent) {
Expand Down Expand Up @@ -585,11 +588,7 @@ private void addMedicationOrderEntryToStock(IStock stock, IArticle article) {
private List<IStock> getPatientStocksWithStockEntry() {
IQuery<IStock> query = coreModelService.getQuery(IStock.class);
query.and("id", COMPARATOR.LIKE, "PatientStock-%");
// Represents inactive PEA order
return query.execute().stream().filter(stock -> !stock.getStockEntries().isEmpty())
.filter(stock -> stock.getStockEntries().stream()
.anyMatch(entry -> entry.getMaximumStock() != 0 || entry.getMinimumStock() != 0))
.toList();
return query.execute();
}

@SuppressWarnings("unchecked")
Expand All @@ -610,7 +609,7 @@ private void updateStockImageState(IStock stock) {
private int calculateStockState(IStock stock) {
int number = 0;
for (IStockEntry entry : stock.getStockEntries()) {

MediorderEntryState entryState = MediorderPartUtil.determineState(entry);
number = switch (entryState) {
case IN_STOCK -> 1;
Expand All @@ -625,5 +624,4 @@ private int calculateStockState(IStock stock) {
private int getImageForStock(IStock stock) {
return imageStockStates.computeIfAbsent(stock, this::calculateStockState);
}

}

0 comments on commit a89de09

Please sign in to comment.