Skip to content
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

2.7 release #16

Merged
merged 28 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
36286df
Add developer onboarding guide
stefpiatek Nov 17, 2023
50b77dd
Increment emap versions
stefpiatek Nov 17, 2023
eaa4d18
Merge branch 'main' into stef/2.7-release
stefpiatek Nov 17, 2023
938c6e1
Remove unnecessary check for PR in comment action
stefpiatek Nov 17, 2023
9ae8443
Add health endpoint to hl7 reader
stefpiatek Feb 9, 2024
d6ad25e
Merge remote-tracking branch 'origin/main' into stef/2.7-release
stefpiatek Feb 9, 2024
9172484
Document changing the actuator port in release SOP
stefpiatek Feb 9, 2024
f47a3cc
Render mermaid inline in markdown
stefpiatek Feb 9, 2024
36687c2
Add batch processor to hoover diagram
stefpiatek Feb 9, 2024
cf47db0
Add batch processor to hoover diagram
stefpiatek Feb 9, 2024
dc26028
Tidy up formatting
stefpiatek Feb 9, 2024
c138cad
Try removing direction in mermaid
stefpiatek Feb 9, 2024
aa9a616
Use rendered mermaid
stefpiatek Feb 9, 2024
6f3010f
Move onboarding file to dev
stefpiatek Feb 9, 2024
3b65160
Fix mermaid styling?
stefpiatek Feb 9, 2024
35aa945
Add 2.7 release changelog
stefpiatek Feb 14, 2024
710769b
Link to release docs README.md
stefpiatek Feb 14, 2024
3e42d97
Link to release docs README.md
stefpiatek Feb 14, 2024
d145e68
Debug CORS
stefpiatek Feb 22, 2024
c98a946
Debug CORS
stefpiatek Feb 22, 2024
04a753f
Update spring boot starter
stefpiatek Feb 22, 2024
cad447f
Add hospital visit index
stefpiatek Apr 12, 2024
5773817
Try setting port in global config
stefpiatek Apr 12, 2024
8df2547
Get global config file from filename
stefpiatek Apr 12, 2024
e94b445
Don't inject ports anymore
stefpiatek Apr 12, 2024
377a737
Expose health endpoint
stefpiatek Apr 12, 2024
b26359b
CORS for specific origins
stefpiatek Apr 12, 2024
bcae33d
HL7 reader port should be in global config
stefpiatek Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
template: SOP/pr_checklist.md
- name: Comment
uses: peter-evans/create-or-update-comment@v1
if: ${{ github.event_name == 'pull_request' }}
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.get-pr-checklist.outputs.result }}
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Emap

A monorepo for all core Emap functions

# Basic layout
# Setup

The EMAP project follows this structure, for deploying a live instance of EMAP follow the instructions
in [docs/core.md](docs/core.md).

```
EMAP [your root emap directory]
├── config [config files passed to docker containers, not in any repo]
Expand All @@ -14,8 +19,12 @@ EMAP [your root emap directory]
│ ├── [etc.]
```

# Using IntelliJ with emap
How to [configure IntelliJ](docs/intellij.md) to build emap and run tests.
## Developer onboarding

- How to [configure IntelliJ](docs/intellij.md) to build emap and run tests.
- [Onboarding](docs/dev/onboarding.md) gives details on how data items are processed and the test strategies used.


# Monorepo migration

How were [old repos migrated into this repo?](docs/migration.md)
8 changes: 4 additions & 4 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
<groupId>uk.ac.ucl.rits.inform</groupId>
<artifactId>core</artifactId>
<packaging>jar</packaging>
<version>2.6</version>
<version>2.7</version>
<name>Emap Core Processor</name>
<url>http://maven.apache.org</url>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.13</version>
<version>2.7.18</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<checkstyle.version>10.3.1</checkstyle.version>
<checkstyle.plugin.version>3.3.0</checkstyle.plugin.version>
<emap-star.version>2.6</emap-star.version>
<emap-interchange.version>2.6</emap-interchange.version>
<emap-star.version>2.7</emap-star.version>
<emap-interchange.version>2.7</emap-interchange.version>
<go-offline-maven-plugin.version>1.2.8</go-offline-maven-plugin.version>
</properties>

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This is a work in progress.
* [2021-09-27](changelogs/2021-09-change_log.md)
* [2021-11-30](changelogs/2021-11-change_log.md)
* [2022-02-14](changelogs/2022-02-change_log.md) 💝
* [2024-02-14](changelogs/2024-02-change_log.md) 💝


### Data and Validation
Expand Down
4 changes: 3 additions & 1 deletion docs/SOP/release_procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ At this point we create a list in the planner with vital things to be completed

1. Prepare and do demo.

1. Shut down old instance.
1. Shut down old instance, changing the HL7_READER_PORT in the global-configuration.yaml to something other than 8080.

1. Update the HL7_READER_PORT in the global-configuration.yaml in the new instance to 8080 and re-up the hl7-reader.
86 changes: 86 additions & 0 deletions docs/changelogs/2024-02-change_log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# EMAP Release

**Date: 2024-02-14 Changes in this release**

---

### Changes/fixes

- We have added a healthcheck endpoint for the hl7-reader, so that users can check the status of the hl7-reader without
needing to access the server directly.
- The current live version can be found at: `http://<GAE hosting EMAP>:8080/actuator/health`
- Please contact the developer team to find out the GAE hostname.
- All services now run using Java 17 (LTS)
- Open source release using mono-repo
- Improved testing to ensure database consistency

### Tables changed

Department specialities can change over time, we've updated the database to reflect this.
The following tables have been updated:

| Table | Attributes added | Attributes removed |
|:----------------|:-----------------|:-------------------|
| DepartmentState | speciality | - |
| Department | - | speciality


```mermaid
erDiagram
bed {
varchar(255) hl7string
bigint room_id
bigint bed_id
}
department {
varchar(255) hl7string
bigint internal_id
varchar(255) name
bigint department_id
}
department_state {
timestamp-with-time-zone stored_from
timestamp-with-time-zone valid_from
timestamp-with-time-zone stored_until
timestamp-with-time-zone valid_until
varchar(255) speciality
varchar(255) status
bigint department_id
bigint department_state_id
}
location {
varchar(255) location_string
bigint bed_id
bigint department_id
bigint room_id
bigint location_id
}
room {
varchar(255) hl7string
varchar(255) name
bigint department_id
bigint room_id
}

department ||--|{ department_state: department_id
location |{--o| department: department_id
location |{--o| room: room_id
location |{--o| bed: bed_id
department ||--o{ room: room_id
room ||--o{ bed: bed_id
```

---
<!--
## Data sources

### Repository Versions

| Repository | Version |
| :- | :-: |
|Hl7-processor | 2.7 |
|Emap_interchange | 2.7 |
|Emap-Core | 2.7 |
|Inform-DB | 2.7 |
|Hoover | 2.7 |
>
66 changes: 66 additions & 0 deletions docs/dev/img/core-message-processing.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
classDiagram
direction BT
class InformDbOperations {
+ processMessage(AdtMessage) void
+ processMessage(LabOrderMsg) void
}
class LabCache {
+ saveEntityAndUpdateCache(RowState~LabBattery, LabBatteryAudit~) LabBattery
+ updateLabTestDefinitionCache(RowState~LabTestDefinition, LabTestDefinitionAudit~) LabTestDefinition
+ findExistingLabTestDefinition(String, String) LabTestDefinition
+ createLabBatteryElementIfNotExists(LabTestDefinition, LabBattery, Instant, Instant) LabBatteryElement
}
class LabController {
+ processLabOrder(Mrn, HospitalVisit?, LabOrderMsg, Instant) void
+ deleteLabOrdersForVisit(HospitalVisit, Instant, Instant) void
+ processLabMetadata(LabMetadataMsg, Instant) void
}
class LabOrderAuditRepository {
<<Interface>>
+ findAllIds(Long, Long, Instant, String) List~Long~
+ previouslyDeleted(Long, Long, InterchangeValue~Instant~, InterchangeValue~String~) boolean
+ findAllByHospitalVisitIdIn(Iterable~Long~) List~LabOrderAudit~
}
class LabOrderController {
+ processSampleAndOrderInformation(Mrn, HospitalVisit, LabBattery, LabOrderMsg, Instant, Instant) LabOrder
+ deleteLabOrder(LabOrder, Instant, Instant) void
+ findLabBatteryOrThrow(String, String) LabBattery
+ getLabOrdersForVisit(HospitalVisit) List~LabOrder~
+ processLabSampleAndDeleteLabOrder(Mrn, LabBattery, HospitalVisit, LabOrderMsg, Instant, Instant) void
+ getOrCreateLabBattery(String, String, Instant, Instant) LabBattery
}
class LabOrderRepository {
<<Interface>>
+ findByLabBatteryIdAndLabSampleId(LabBattery, LabSample) Optional~LabOrder~
+ findByLabBatteryIdAndLabSampleIdAndValidFromBefore(LabBattery, LabSample, Instant) Optional~LabOrder~
+ findByLabBatteryIdBatteryCodeAndLabSampleId(String, LabSample) Optional~LabOrder~
+ findByLabSampleIdExternalLabNumber(String) Optional~LabOrder~
+ findAllByHospitalVisitId(HospitalVisit) List~LabOrder~
}
class LabProcessor {
+ processMessage(LabMetadataMsg, Instant) void
+ processMessage(LabOrderMsg, Instant) void
}
class LabTestDefinitionAuditRepository {
<<Interface>>
}
class LabTestDefinitionRepository {
<<Interface>>
+ findByLabProviderAndTestLabCode(String, String) Optional~LabTestDefinition~
+ findByTestLabCode(String) Optional~LabTestDefinition~
}
class EmapOperationMessageProcessor {
<<Interface>>
+ processMessage(LabMetadataMsg) void
+ processMessage(AdtMessage) void
}

InformDbOperations *--> LabProcessor
LabCache *--> LabTestDefinitionAuditRepository
LabCache *--> LabTestDefinitionRepository
LabController *--> LabCache
LabController *--> LabOrderController
LabOrderController *--> LabOrderAuditRepository
LabOrderController *--> LabOrderRepository
LabProcessor *--> LabController
InformDbOperations ..> EmapOperationMessageProcessor
1 change: 1 addition & 0 deletions docs/dev/img/core-message-processing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions docs/dev/img/hl7-message-processing.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
classDiagram
direction BT
class AblLabBuilder {
+ build(String, ORU_R30) Collection~LabOrderMsg~
}
class AppHl7 {
+ main(String[]) void
+ mainLoop(Publisher, IdsOperations) CommandLineRunner
}
class ConsultFactory {
~ makeConsult(String, ORM_O01) ConsultRequest
}
class IdsOperations {
+ getHl7DataSource() EmapDataSource
+ getNextHL7IdsRecordBlocking(int) IdsMaster
+ close() void
+ parseAndSendNextHl7(Publisher, PipeParser) void
+ getNextHL7IdsRecord(int) IdsMaster
+ messageFromHl7Message(Message, int) List~EmapOperationMessage~
+ populateIDS() CommandLineRunner
+ getIdsEmptyOnInit() boolean
~ getLatestProcessedId() IdsProgress
}
class LabFunnel {
+ buildMessages(String, ORU_R30, OrderCodingSystem) Collection~LabOrderMsg~
+ buildMessages(String, ORR_O02, OrderCodingSystem) Collection~LabOrderMsg~
+ buildMessages(String, ORU_R01, OrderCodingSystem) Collection~LabOrderMsg~
+ buildMessages(String, ORM_O01, OrderCodingSystem) List~LabOrderMsg~
}
class LabOrderBuilder {
~ getCodingSystem() OrderCodingSystem
~ getEpicCareOrderNumberOrc() String
~ setQuestions(Collection~NTE~, String, Pattern) void
+ getMsg() LabOrderMsg
~ getEpicCareOrderNumberObr() String
~ setBatteryCodingSystem() void
~ populateOrderInformation(ORC, OBR) void
~ populateObrFields(OBR, boolean) void
~ setSourceAndPatientIdentifiers(String, PatientInfoHl7) void
~ populateObrFields(OBR) void
~ setOrderTemporalInformation(Instant) void
}
class OrderAndResultService {
~ buildMessages(String, ORR_O02) Collection~EmapOperationMessage~
~ buildMessages(String, ORM_O01) Collection~EmapOperationMessage~
~ buildMessages(String, ORU_R30) Collection~EmapOperationMessage~
~ buildMessages(String, ORU_R01) Collection~EmapOperationMessage~
}
class WinPathLabBuilder {
+ build(String, ORU_R01) Collection~LabOrderMsg~
+ build(String, ORR_O02) Collection~LabOrderMsg~
+ build(String, ORM_O01) List~LabOrderMsg~
}
class ConsultRequest {
+ getEpicConsultId() Long
+ getMrn() String
+ setQuestions(Map~String, String~) void
+ getQuestions() Map~String, String~
+ setMrn(String) void
+ processMessage(EmapOperationMessageProcessor) void
}
class LabOrderMsg {
+ getSpecimenType() InterchangeValue~String~
+ getOrderControlId() String
+ getLabResultMsgs() List~LabResultMsg~
+ setOrderDateTime(InterchangeValue~Instant~) void
+ setOrderControlId(String) void
+ setSpecimenType(InterchangeValue~String~) void
+ processMessage(EmapOperationMessageProcessor) void
+ addLabResult(LabResultMsg) void
}

AblLabBuilder --|> LabOrderBuilder
AppHl7 ..> IdsOperations
IdsOperations *--> OrderAndResultService
LabFunnel ..> AblLabBuilder
LabFunnel ..> WinPathLabBuilder
OrderAndResultService *--> ConsultFactory
OrderAndResultService ..> LabFunnel
WinPathLabBuilder --|> LabOrderBuilder
LabOrderBuilder ..> LabOrderMsg: «create»
ConsultFactory ..> ConsultRequest: «create»
1 change: 1 addition & 0 deletions docs/dev/img/hl7-message-processing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions docs/dev/img/hoover-development.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
classDiagram
direction BT
class Application {
+ main(String[]) void
+ locationMetadataProcessor(LocationMetadataQueryStrategy) Processor
+ flowsheetProcessor(FlowsheetQueryStrategy) Processor
+ runBatchProcessor(Processor, Processor, ...) BatchProcessor
}
class LocationMetadata {
+ getHl7String() String
+ getDepartmentId() Long
+ getRoomMetadata() RoomMetadata
+ getBedMetadata() BedMetadata
+ setHl7String(String) void
+ setDepartmentId(Long) void
+ setRoomMetadata(RoomMetadata) void
+ setBedMetadata(BedMetadata) void
+ processMessage(EmapOperationMessageProcessor) void
}
class LocationMetadataDTO {
+ getInterchangeMessage() LocationMetadata
}
class LocationMetadataQueryStrategy {
+ getSqlQueryFilename() String
+ getInstantCalculator() InstantCalculator
+ fixInitialProgress(Instant) Instant
~ getClarityData(Instant) List~LocationMetadataDTO~
+ getBatchOfInterchangeMessages(Instant, Instant, String) List~ImmutablePair~ EmapOperationMessage, String~~
+ getUpdatedProgress() EtlHooverProgress
+ getName() String
}
class QueryStrategy {
<<Interface>>
+ getBatchOfInterchangeMessages(Instant, Instant, String) List~ImmutablePair~ EmapOperationMessage, String~~
+ fixInitialProgress(Instant) Instant
+ getInstantCalculator() InstantCalculator
+ getName() String
+ getUpdatedProgress() EtlHooverProgress
+ getBatchOfInterchangeMessages(DataTypeProgress) List~ImmutablePair~ EmapOperationMessage, String~~
+ getSqlQueryFilename() String
+ interpretPreviousProgress(EtlHooverProgress) DataTypeProgress
+ getSqlQuery() String
}
class Processor {
+ getDataType() String
+ getPreviousProgress() List~EtlHooverProgress~
+ execute() boolean
+ executeOne(EtlHooverProgress) boolean
}

class BatchProcessor {
+ registerDataTypeProcessor(Processor) void
}

Application ..> LocationMetadataQueryStrategy
LocationMetadataDTO ..> LocationMetadata: «create»
LocationMetadataQueryStrategy ..> LocationMetadata
LocationMetadataQueryStrategy ..> LocationMetadataDTO
LocationMetadataQueryStrategy ..|> QueryStrategy
Processor *--> QueryStrategy
BatchProcessor "1" *--> "dataTypeProcessors *" Processor
Application ..> Processor
Application ..> BatchProcessor: «create»
1 change: 1 addition & 0 deletions docs/dev/img/hoover-development.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading