Skip to content

Commit 04df861

Browse files
More comments in PHT_on_FHIR and remove unused imports
1 parent 1f22342 commit 04df861

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

examples/PHT_on_FHIR/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
# We use V1 RC4 for implementing the train.
2+
# Also, we use the -fhir image such that the fhirclient and SPAQRLWrapper modules are available
13
FROM personalhealthtrain/train-api-python:1.0rc4-fhir
24
LABEL maintainer="luk.zim91@gmail.com"
35

6+
# Copy all required source code files for the train inside the image
47
COPY entrypoint.py /opt/entrypoint.py
58
COPY sparql.py /opt/sparql.py
69
COPY fhir.py /opt/fhir.py

examples/PHT_on_FHIR/entrypoint.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sparql
44
import os
55

6+
# The PHT API dependencies
67
from pht.train import SimpleTrain
78
from pht.internal import StationRuntimeInfo, ConjunctionBuilder
89
from pht.train.response import RunResponse
@@ -26,6 +27,10 @@ def __init__(self):
2627
self.output_file = '/opt/train/output.txt'
2728

2829
def requirements(self) -> ConjunctionBuilder:
30+
# Declare the requirements of this train. The station needs to provide:
31+
# * The endpoint type (either 'FHIR' or 'SPARQL'
32+
# * The endpoint url
33+
# * The endpoint token
2934
return Require(self.endpoint_type) & Require(self.endpoint_url) & Require(self.endpoint_token)
3035

3136
def model_summary(self) -> str:

examples/PHT_on_FHIR/fhir.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from fhirclient import client
2-
from fhirclient.models.patient import Patient
3-
from fhirclient.models import fhirsearch as S
42
from datetime import datetime
53
from datetime import date
6-
from fhirclient.models import fhirsearch
74

85

96
def perform_in(srch_str, server,apiBase):

0 commit comments

Comments
 (0)