-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EA-198: Add support for configuring Mother Child relationships within…
… the EMR API module
- Loading branch information
1 parent
76327e3
commit 26e9ff6
Showing
8 changed files
with
572 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
api/src/main/java/org/openmrs/module/emrapi/maternal/Mother.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.openmrs.module.emrapi.maternal; | ||
|
||
import lombok.Data; | ||
import org.openmrs.Patient; | ||
import org.openmrs.module.emrapi.adt.InpatientAdmission; | ||
|
||
|
||
@Data | ||
public class Mother { | ||
private Patient mother; | ||
private Patient newborn; | ||
private InpatientAdmission motherAdmission; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
select | ||
mother, | ||
baby, | ||
motherVisit | ||
from | ||
Relationship as motherChildRelationship, Visit as motherVisit, Visit as babyVisit | ||
inner join motherChildRelationship.personA as mother | ||
inner join motherChildRelationship.personB as baby | ||
where | ||
baby in (:babies) | ||
and motherChildRelationship.relationshipType = :motherChildRelationshipType | ||
and motherVisit.patient = mother and motherVisit.stopDatetime is null | ||
and babyVisit.patient = baby and babyVisit.stopDatetime is null | ||
and babyVisit.location = motherVisit.location | ||
and mother.voided = false and baby.voided = false and motherChildRelationship.voided = false and motherVisit.voided = false and babyVisit.voided = false | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.