Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #16 from mcode/revert-15-fork-sync
Browse files Browse the repository at this point in the history
Revert "Fork Auto Sync"
  • Loading branch information
smalho01 authored Mar 3, 2022
2 parents 439e53d + e967a6f commit 0e24cc7
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 181 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docker-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ jobs:
context: .
push: true
tags: codexrems/crd:REMSvlatest

22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM gradle:6.9.0-jdk11
# Copy app files to container
COPY --chown=gradle:gradle . /CRD/
# Set working directory so that all subsequent command runs in this folder
WORKDIR /CRD/server/
# Embed CDS Library
RUN gradle embedCdsLibrary
# Expose port to access the app
RUN gradle build
EXPOSE 8090
# Command to run our app
CMD gradle bootRun
# Copy app files to container
COPY --chown=gradle:gradle . /CRD/
# Set working directory so that all subsequent command runs in this folder
WORKDIR /CRD
# Embed CDS Library
RUN gradle embedCdsLibrary
# Expose port to access the app
RUN gradle build
EXPOSE 8090
# Command to run our app
CMD gradle bootRun
26 changes: 13 additions & 13 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Base image
FROM gradle:6.9.0-jdk11
# Copy app files to container
COPY --chown=gradle:gradle . /CRD/
# Set working directory so that all subsequent command runs in this folder
WORKDIR /CRD
# Embed CDS Library
# RUN gradle embedCdsLibrary
RUN gradle build
# Expose port to access the app
EXPOSE 8090
EXPOSE 8091
# Command to run our app
CMD ./dockerRunnerDev.sh
FROM gradle:6.9.0-jdk11
# Copy app files to container
COPY --chown=gradle:gradle . /CRD/
# Set working directory so that all subsequent command runs in this folder
WORKDIR /CRD
# Embed CDS Library
# RUN gradle embedCdsLibrary
RUN gradle build
# Expose port to access the app
EXPOSE 8090
EXPOSE 8091
# Command to run our app
CMD ./dockerRunnerDev.sh
40 changes: 20 additions & 20 deletions dockerRunnerDev.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#!/bin/bash

# Handle closing application on signal interrupt (ctrl + c)
trap 'kill $CONTINUOUS_BUILD_PID $SERVER_PID; gradle --stop; exit' INT
trap 'kill $CONTINUOUS_BUILD_PID $SERVER_PID; gradle --stop; exit' INT

mkdir logs
# Reset log file content for new application boot
echo "*** Logs for 'gradle installBootDist --continuous' ***" > ./logs/builder.log
echo "*** Logs for 'gradle bootRun' ***" > ./logs/runner.log
mkdir logs
# Reset log file content for new application boot
echo "*** Logs for 'gradle installBootDist --continuous' ***" > ./logs/builder.log
echo "*** Logs for 'gradle bootRun' ***" > ./logs/runner.log

# Print that the application is starting in watch mode
echo "starting application in watch mode..."
# Print that the application is starting in watch mode
echo "starting application in watch mode..."

# Start the continious build listener process
echo "starting continuous build listener..."
gradle build --continuous 2>&1 | tee ./logs/builder.log & CONTINUOUS_BUILD_PID=$!
# Start the continious build listener process
echo "starting continuous build listener..."
gradle build --continuous 2>&1 | tee ./logs/builder.log & CONTINUOUS_BUILD_PID=$!

# Start server process once initial build finishes
( while ! grep -m1 'BUILD SUCCESSFUL' < ./logs/builder.log; do
sleep 1
done
echo "starting crd server in debug mode..."
gradle bootRun -Pdebug 2>&1 | tee ./logs/runner.log ) & SERVER_PID=$!
# Start server process once initial build finishes
( while ! grep -m1 'BUILD SUCCESSFUL' < ./logs/builder.log; do
sleep 1
done
echo "starting crd server in debug mode..."
gradle bootRun -Pdebug | tee ./logs/runner.log ) & SERVER_PID=$!

# Handle application background process exiting
wait $CONTINUOUS_BUILD_PID $SERVER_PID
EXIT_CODE=$?
echo "application exited with exit code $EXIT_CODE..."
# Handle application background process exiting
wait $CONTINUOUS_BUILD_PID $SERVER_PID
EXIT_CODE=$?
echo "application exited with exit code $EXIT_CODE..."
19 changes: 0 additions & 19 deletions resources/src/main/java/org/cdshooks/Coding.java

This file was deleted.

16 changes: 3 additions & 13 deletions resources/src/main/java/org/cdshooks/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ public class Source {

private String url = null;

private String icon = null;

private Coding topic = null;

public String getLabel() {
return label;
}

public void setLabel(String label) { this.label = label; }
public void setLabel(String label) {
this.label = label;
}

public String getUrl() {
return url;
Expand All @@ -22,12 +20,4 @@ public String getUrl() {
public void setUrl(String url) {
this.url = url;
}

public String getIcon() { return icon; }

public void setIcon(String icon) { this.icon = icon; }

public Coding getTopic() { return topic; }

public void setTopic(Coding topic) { this.topic = topic; }
}
44 changes: 0 additions & 44 deletions resources/src/main/java/org/hl7/davinci/r4/CardTypes.java

This file was deleted.

4 changes: 1 addition & 3 deletions resources/src/main/java/org/hl7/davinci/r4/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ public static List<Organization> getPayors(List<Coverage> coverages) {
for (Coverage coverage: coverages){
for (Reference ref: coverage.getPayor()){
Organization organization = (Organization) ref.getResource();
if (organization != null) {
payors.add(organization);
}
payors.add(organization);
}
}
return payors;
Expand Down
2 changes: 0 additions & 2 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ bootRun {
if (project.hasProperty('debug')) {
jvmArgs=["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8091"]
}

}


dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.hl7.davinci.endpoint.database.RequestService;
import org.hl7.davinci.endpoint.files.FileStore;
import org.hl7.davinci.endpoint.rules.CoverageRequirementRuleResult;
import org.hl7.davinci.r4.CardTypes;
import org.hl7.davinci.r4.crdhook.DiscoveryExtension;
import org.hl7.davinci.r4.crdhook.orderselect.OrderSelectRequest;
import org.hl7.davinci.endpoint.database.FhirResourceRepository;
Expand Down Expand Up @@ -86,7 +85,7 @@ public CdsResponse handleRequest(@Valid @RequestBody requestTypeT request, URL a
requestLog.advanceTimeline(requestService);
} catch (RequestIncompleteException e) {
logger.warn(e.getMessage() + "; summary card sent to client");
response.addCard(CardBuilder.summaryCard(CardTypes.COVERAGE, e.getMessage()));
response.addCard(CardBuilder.summaryCard(e.getMessage()));
requestLog.setCardListFromCards(response.getCards());
requestLog.setResults(e.getMessage());
requestService.edit(requestLog);
Expand Down Expand Up @@ -134,12 +133,7 @@ public CdsResponse handleRequest(@Valid @RequestBody requestTypeT request, URL a
|| StringUtils.isNotEmpty(coverageRequirements.getQuestionnaireDispenseUri())
|| StringUtils.isNotEmpty(coverageRequirements.getQuestionnaireAdditionalUri())) {
List<Link> smartAppLinks = createQuestionnaireLinks(request, applicationBaseUrl, lookupResult, results);

if (coverageRequirements.isPriorAuthRequired()) {
response.addCard(CardBuilder.transform(CardTypes.PRIOR_AUTH, results, smartAppLinks));
} else if (coverageRequirements.isDocumentationRequired()) {
response.addCard(CardBuilder.transform(CardTypes.DTR_CLIN, results, smartAppLinks));
}
response.addCard(CardBuilder.transform(results, smartAppLinks));

// add a card for an alternative therapy if there is one
if (results.getAlternativeTherapy().getApplies() && hookConfiguration.getAlternativeTherapy()) {
Expand All @@ -152,12 +146,12 @@ public CdsResponse handleRequest(@Valid @RequestBody requestTypeT request, URL a
}
} else {
logger.warn("Unspecified Questionnaire URI; summary card sent to client");
response.addCard(CardBuilder.transform(CardTypes.COVERAGE, results));
response.addCard(CardBuilder.transform(results));
}
} else {
// no prior auth or documentation required
logger.info("Add the no doc or prior auth required card");
Card card = CardBuilder.transform(CardTypes.COVERAGE, results);
Card card = CardBuilder.transform(results);
card.addSuggestionsItem(CardBuilder.createSuggestionWithNote(card, results.getRequest(), fhirComponents,
"Save Update To EHR", "Update original " + results.getRequest().fhirType() + " to add note",
true));
Expand All @@ -180,9 +174,9 @@ public CdsResponse handleRequest(@Valid @RequestBody requestTypeT request, URL a
if (!foundApplicableRule) {
String msg = "No documentation rules found";
logger.warn(msg + "; summary card sent to client");
response.addCard(CardBuilder.summaryCard(CardTypes.COVERAGE, msg));
response.addCard(CardBuilder.summaryCard(msg));
}
CardBuilder.errorCardIfNonePresent(CardTypes.COVERAGE, response);
CardBuilder.errorCardIfNonePresent(response);
}

// Adding card to requestLog
Expand Down Expand Up @@ -257,6 +251,7 @@ protected Object evaluateStatement(String statement, Context context) {
}



// Implement these in child class
public abstract List<CoverageRequirementRuleResult> createCqlExecutionContexts(requestTypeT request,
FileStore fileStore, String baseUrl) throws RequestIncompleteException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.hl7.davinci.endpoint.cdshooks.services.crd;

import org.cdshooks.Card;
import org.hl7.davinci.r4.CardTypes;
import org.cdshooks.CdsRequest;
import org.cdshooks.CdsResponse;
import org.cdshooks.Hook;
Expand Down Expand Up @@ -62,7 +61,7 @@ public CdsResponse handleRequest(@Valid @RequestBody requestTypeT request, URL a
CdsResponse response = new CdsResponse();
List<Coding> medications = getMedications(request);
for (Coding medication : medications) {
Card card = CardBuilder.summaryCard(CardTypes.COVERAGE, "");
Card card = CardBuilder.summaryCard("");
if (isRemsDrug(medication)) {
card.setSummary(String.format("%s has REMS", medication.getDisplay()));
} else {
Expand Down
Loading

0 comments on commit 0e24cc7

Please sign in to comment.