Skip to content

Commit

Permalink
Add logic to see matches before saving patient (#6)
Browse files Browse the repository at this point in the history
* Add logic to see matches before savinf patient

* Add fixes

* Add more fixes

* Show the transfer Status

* Revert and fix unit test

* add color for matches

* Update buttons

* Update PR

---------

Co-authored-by: aziz <[email protected]>
  • Loading branch information
reagan-meant and azizdiakite authored Apr 10, 2024
1 parent 20b0ae7 commit 83a1744
Show file tree
Hide file tree
Showing 7 changed files with 523 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ public void willStart() {
public void started() {
applicationContext.getAutowireCapableBeanFactory().autowireBean(this);

createFhirPatientIdentierSystem();

log.info("Legacy UI Module started");
}

Expand All @@ -89,37 +87,10 @@ public void stopped() {
log.info("Legacy UI Module stopped");
}

private void createFhirPatientIdentierSystem() {

List<PatientIdentifierType> pidTypes = patientService.getAllPatientIdentifierTypes(false);
for (PatientIdentifierType pidType : pidTypes) {
Optional<FhirPatientIdentifierSystem> existingIdSystem = fhirPatientIdentifierSystemService
.getFhirPatientIdentifierSystem(pidType);
if (existingIdSystem.isPresent()) {
existingIdSystem.get().setPatientIdentifierType(pidType);
//existingIdSystem.get().setUrl("http://openelis-global.org/pat_xx");
existingIdSystem.get().setUrl("https://openmrs.org/" + pidType.getName().replace(" ", "_"));

fhirPatientIdentifierSystemService.saveFhirPatientIdentifierSystem(existingIdSystem.get());
} else {
FhirPatientIdentifierSystem idSystem = new FhirPatientIdentifierSystem();
idSystem.setName(pidType.getName() + " ID System");
idSystem.setPatientIdentifierType(pidType);
pidType.getName();
idSystem.setUrl("https://openmrs.org/" + pidType.getName().replace(" ", "_"));
fhirPatientIdentifierSystemService.saveFhirPatientIdentifierSystem(idSystem);
}
}

/* PatientIdentifierType pidType = patientService
.getPatientIdentifierTypeByUuid("b3b24192-6856-46fd-ab4e-acde31f80c85"); */

}

@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
// TODO Auto-generated method stub
this.applicationContext = applicationContext;
}

}
}
7 changes: 6 additions & 1 deletion omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@
</dependency>

<!-- End OpenMRS core -->

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.1</version>
</dependency>

<dependency>
<groupId>org.openmrs.directwebremoting</groupId>
<artifactId>dwr</artifactId>
Expand Down
Loading

0 comments on commit 83a1744

Please sign in to comment.