-
Notifications
You must be signed in to change notification settings - Fork 23
BAH-4336 | Add. Methods to resolve order location, fullfilling location and concept code #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ured code priority
| return null; | ||
| } | ||
|
|
||
| java.util.Map<String, Object> responseMap = ObjectMapperRepository.objectMapper.readValue(response, java.util.Map.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mapper can be removed.
String response = webClient.get(URI.create(url), Map.class); can be used on line #73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, good catch. will refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } | ||
|
|
||
| private OrderConceptMapping findMappingBySameAsType(OrderConcept concept, String sourceNameToMatch) { | ||
| for (OrderConceptMapping mapping : concept.getMappings()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick : I believe stream would make it more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok with a loop. otherwise, we will have use stream.filter() to filter out empty conceptmaptype, and if not SAME_AS, and also concept source.
...egration-webapp/src/main/java/org/bahmni/module/pacsintegration/services/OpenMRSService.java
Outdated
Show resolved
Hide resolved
...egration-webapp/src/main/java/org/bahmni/module/pacsintegration/services/OpenMRSService.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| private OrderConceptMapping findMappingBySameAsType(OrderConcept concept, String sourceNameToMatch) { | ||
| for (OrderConceptMapping mapping : concept.getMappings()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok with a loop. otherwise, we will have use stream.filter() to filter out empty conceptmaptype, and if not SAME_AS, and also concept source.
| liquibase.change-log=classpath:db/changelog/liquibase.xml | ||
|
|
||
| enable.scheduling=true | ||
| enable.scheduling=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are using spring scheduling? thought we were using quartz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this repo seems to be using Spring Scheduler. https://github.com/Bahmni/pacs-integration/blob/master/pacs-integration-webapp/src/main/java/org/bahmni/module/pacsintegration/atomfeed/ScheduledTasks.java.
The tasks are just defined in a table named as quartz_cron_scheduler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely used Quartz here in the past. I am not sure if thats still applicable or was changed some point of time. Check QuartzCronScheduler.java
Summary
This PR adds configurable concept code and location resolution for PACS integration orders.
Key Changes:
Concept Code Resolver
Resolves concept codes from OpenMRS orders using a priority-based fallback mechanism:
Resolution Algorithm:
concept.code.resolver.source.priority, e.g., "PACS Procedure Code, LOINC, ICD-10, SNOMED")Output: HL7CodedElement with code identifier, text description, and coding system designator
Location Resolver
Resolves source and fulfilling locations for orders using tag-based filtering and attribute lookup:
Source Location (Visit Location) Resolution:
Fulfilling Location Resolution:
REQUESTED_LOCATIONattribute (configurable viaorder.requested.location.attribute.name)Output: OrderLocationInfo containing both fulfilling and source LocationDTOs (UUID, name, display)
Supporting Infrastructure
OpenMRSServicewith methods to fetch order details, traverse location hierarchy, and query location by UUIDConfiguration Properties:
concept.code.resolver.source.priority: Comma-separated list of code sources (default: "PACS Procedure Code")order.requested.location.attribute.name: Attribute name for requested location (default: "REQUESTED_LOCATION")