Skip to content

Commit

Permalink
Merge pull request #211 from project-husky/develop-3.x
Browse files Browse the repository at this point in the history
Merge for release 3.0.2
  • Loading branch information
ralych authored Dec 5, 2024
2 parents e22eb4a + a65be13 commit 569992f
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 157 deletions.
9 changes: 0 additions & 9 deletions husky-common/husky-common-at/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
9 changes: 0 additions & 9 deletions husky-common/husky-common-ch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
9 changes: 0 additions & 9 deletions husky-common/husky-common-gen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,6 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>
husky-fhir-emed-ch-epr-narrative</artifactId>
<name>Husky FHIR eMedication
Switzerland EPR Narrative</name>
<artifactId>husky-fhir-emed-ch-epr-narrative</artifactId>
<name>Husky FHIR eMed EPR Narrative</name>
<parent>
<artifactId>husky-fhir-emed-ch</artifactId>
<groupId>org.projecthusky.fhir.emed.ch</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,41 @@ <h2>Dernière modification</h2>

<div id="active-treatments">
<h2 id="active-treatments-header">Traitements actifs</h2>
<th:block th:insert="~{medication_card_fragments :: table(${activeTreatments}, ${lang})}"/>
</div>
<div id="reserve-treatments">
<h2 id="reserve-treatments-header">Traitements en réserve</h2>
<th:block th:insert="~{medication_card_fragments :: table(${asneededTreatments}, ${lang})}"/>
<table class="treatments">
<thead>
<tr>
<td rowspan="2" colspan="2">Nom du médicament</td>
<td colspan="4">Dosage</td>
<td rowspan="2">Commentaire</td>
<td rowspan="2">Voie et localisation</td>
</tr>
<tr>
<td>Matin</td>
<td>Midi</td>
<td>Soir</td>
<td>Nuit</td>
</tr>
</thead>
<th:block th:each="statements: ${activeTreatments}">
<th:block th:insert="~{medication_card_fragments::treatmentPlan(${statements.value}, ${lang})}"/>
</th:block>
<th:block th:if="${!asneededTreatments.isEmpty()}">
<tbody>
<tr>
<td colspan="8" class="as-needed-treatments-header">Traitements en réserve:</td>
</tr>
</tbody>
<th:block th:each="statements: ${asneededTreatments}">
<th:block th:insert="~{medication_card_fragments::treatmentPlan(${statements.value}, ${lang})}"/>
</th:block>
</th:block>
<th:block th:if="${activeTreatments.isEmpty() && asneededTreatments.isEmpty()}">
<tbody>
<tr>
<td colspan="8" class="no-treatment">Aucun traitement</td>
</tr>
</tbody>
</th:block>
</table>
</div>
</th:block>
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,6 @@
~ on the basis of the eHealth Connector opensource project from June 28, 2021,
~ whereas medshare GmbH is the initial and main contributor/author of the eHealth Connector.
*/-->
<table th:fragment="table(treatments, lang)">
<thead>
<tr>
<td rowspan="2" colspan="2">Nom du médicament</td>
<td colspan="4">Dosage</td>
<td rowspan="2">Commentaire</td>
<td rowspan="2">Voie et localisation</td>
</tr>
<tr>
<td>Matin</td>
<td>Midi</td>
<td>Soir</td>
<td>Nuit</td>
</tr>
</thead>
<th:block th:each="statements: ${treatments}">
<th:block th:insert="~{::treatmentPlan(${statements.value}, ${lang})}"/>
</th:block>
<th:block th:if="${treatments.isEmpty()}">
<tbody>
<tr>
<td colspan="8" class="no-treatment">Aucun traitement</td>
</tr>
</tbody>
</th:block>
</table>

<th:block th:fragment="treatmentPlan(statements, lang)">
<tbody class="treatment-plan-body">
<th:block th:each="statement, iStat: ${statements}">
Expand All @@ -45,11 +18,37 @@
<th:block th:fragment="table-line(medStmt, dosage, index, size, lang)">
<tr class="statement-row" th:classappend="${(index == 0)? ' treatment-first-row' : ''}">
<th:block th:if="${index} == 0">
<td class="treatment-plan-common-cell" th:rowspan="${size} * 2"/>
<td class="treatment-plan-common-cell" th:rowspan="${size}"/>
</th:block>
<!-- Nom du médicament -->
<td>
[[${medStmt.resolveMedication().resolveMedicationName()}]]
<td class="medication" th:with="medication=${medStmt.resolveMedication()}">
<div class="medication-name">[[${medication.resolveMedicationName()}]]</div>
<div class="medication-description">
<th:block th:with="activeIngredients=${medication.resolveActiveIngredients()}">
<ul class="medication-active-ingredients" th:unless="${activeIngredients.isEmpty}">
<li th:each="activeIngredient : ${activeIngredients}">
[[${activeIngredient.resolveActiveIngredient().getDisplayName(lang.getLanguageCode())}]]
</li>
</ul>
</th:block>

<div class="treatment-line-period" th:if="${dosage.period().hasStart() and dosage.period().hasEnd()}">
À prendre du
<th:block th:insert="~{datatypes :: date-time(${dosage.period().getStartElement()}, ${lang})}"/>
au
<th:block th:insert="~{datatypes :: date-time(${dosage.period().getEndElement()}, ${lang})}"/>
</div>
<div class="treatment-line-period" th:if="${dosage.period().hasStart() and not dosage.period().hasEnd()}">
À prendre dès le
<th:block th:insert="~{datatypes :: date-time(${dosage.period().getStartElement()}, ${lang})}"/>
</div>
<div class="treatment-line-period" th:if="${not dosage.period().hasStart() and dosage.period().hasEnd()}">
À prendre jusqu'au
<th:block th:insert="~{datatypes :: date-time(${dosage.period().getEndElement()}, ${lang})}"/>
</div>

<div class="treatment-line-max-dose" th:if="${dosage.hasMaxDose()}" th:insert="~{datatypes::max-doses(${dosage}, ${lang})}"/>
</div>
</td>

<!-- Dosage -->
Expand All @@ -66,10 +65,14 @@
<td th:insert="~{datatypes :: intake-timing(${dosage.hasNightSimpleEventTiming}, ${lang})}"/>
</th:block>
<th:block th:if="${dosage.hasSimpleDose}">
<td colspan="4" th:insert="~{datatypes :: simple-dose(${dosage.simpleDose}, ${lang})}"/>
<td colspan="4" class="daily-intake">
*** <th:block th:insert="~{datatypes :: simple-dose(${dosage.simpleDose}, ${lang})}"/> par jour ***
</td>
</th:block>
<th:block th:unless="${dosage.hasIntakes or dosage.hasSimpleEventTimings or dosage.hasSimpleDose}">
<td colspan="4" th:text="${dosage.patientInstructions}"/>
<td colspan="4" class="daily-instructions">
*** <th:block th:text="${dosage.patientInstructions}"/> ***
</td>
</th:block>

<!-- Commentaire (raison et instructions au patient -->
Expand All @@ -89,24 +92,4 @@
th:text="${fopase.getMessage(dosage.routeOfAdministration(), lang)}"/>
</td>
</tr>
<tr>
<td colspan="8" class="description">
<th:block th:if="${dosage.period().hasStart() and dosage.period().hasEnd()}">
À prendre du
<th:block th:insert="~{datatypes :: date-time(${dosage.period().getStartElement()}, ${lang})}"/>
au
<th:block th:insert="~{datatypes :: date-time(${dosage.period().getEndElement()}, ${lang})}"/>
</th:block>
<th:block th:if="${dosage.period().hasStart() and not dosage.period().hasEnd()}">
À prendre dès le
<th:block th:insert="~{datatypes :: date-time(${dosage.period().getStartElement()}, ${lang})}"/>
</th:block>
<th:block th:if="${not dosage.period().hasStart() and dosage.period().hasEnd()}">
À prendre jusqu'au
<th:block th:insert="~{datatypes :: date-time(${dosage.period().getEndElement()}, ${lang})}"/>
</th:block>

<th:block th:if="${dosage.hasMaxDose()}" th:insert="~{datatypes::max-doses(${dosage}, ${lang})}"/>
</td>
</tr>
</th:block>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import ca.uhn.fhir.model.api.annotation.ResourceDef;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.Medication;
import org.hl7.fhir.r4.model.UriType;
Expand Down Expand Up @@ -212,8 +211,10 @@ public PharmaceuticalDoseFormEdqm resolveForm() throws InvalidEmedContentExcepti
public List<ChEmedEprMedicationIngredient> resolveActiveIngredients() {
return this.getIngredient().stream()
.filter(MedicationIngredientComponent::getIsActive)
.filter(ChEmedEprMedicationIngredient.class::isInstance)
.map(ChEmedEprMedicationIngredient.class::cast)
.map(ingredient -> {
if (ingredient instanceof ChEmedEprMedicationIngredient chEmedEprIngredient) return chEmedEprIngredient;
else return new ChEmedEprMedicationIngredient(ingredient);
})
.toList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ public ChEmedEprMedicationIngredient() {
super();
}

/**
* Constructor from {@link Medication.MedicationIngredientComponent} object.
* @param ingredientComponent the ingredient
*/
public ChEmedEprMedicationIngredient(final Medication.MedicationIngredientComponent ingredientComponent) {
ingredientComponent.copyValues(this);
}

/**
* Resolves the dose per unit.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
25 changes: 9 additions & 16 deletions husky-fhir/husky-fhir-structures/husky-fhir-structures-gen/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>husky-fhir-structures-gen</artifactId>
<name>Husky FHIR Structures Generic</name>
Expand All @@ -14,9 +16,9 @@
<dependencies>
<!-- own modules -->
<dependency>
<groupId>org.projecthusky.common</groupId>
<artifactId>husky-common-gen</artifactId>
<version>3.0.2-SNAPSHOT</version>
<groupId>org.projecthusky.common</groupId>
<artifactId>husky-common-gen</artifactId>
<version>3.0.2-SNAPSHOT</version>
</dependency>

<!-- other dependencies -->
Expand All @@ -25,9 +27,9 @@
<artifactId>hapi-fhir-structures-r4</artifactId>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-r4</artifactId>
</dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-r4</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand All @@ -47,15 +49,6 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Loading

0 comments on commit 569992f

Please sign in to comment.