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

Comparison between new 2024 draft content and master branch #17

Draft
wants to merge 123 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
5fd04c0
Draft range guidance
benjaminflessner Jan 9, 2024
a2226ff
Update after SD discussion
benjaminflessner Jan 11, 2024
e360d22
Make race/ethnicity links - update guidance
benjaminflessner Jan 11, 2024
fe2dbda
Clean up precondition
benjaminflessner Jan 11, 2024
80ceb78
Merge branch 'range' into 2024
benjaminflessner Jan 16, 2024
3e1932c
Draft encounters, vitals, and results from Connectathon
benjaminflessner Jan 16, 2024
8c777ad
Bump CPT note a line up
benjaminflessner Jan 17, 2024
095bbdc
Add functioncode
benjaminflessner Jan 17, 2024
5084309
Add note about timezone offset preservation
benjaminflessner Jan 17, 2024
5ab5f9f
Update code/status notes from CAT
benjaminflessner Jan 17, 2024
51bab42
Draft notes mapping
benjaminflessner Jan 17, 2024
db4d8c0
Add link to notes on index page
benjaminflessner Jan 17, 2024
f641c7c
Experimentally model EncompassingEncounter mapping
benjaminflessner Jan 22, 2024
b7eb958
Add blank line to fix table
benjaminflessner Feb 2, 2024
aab8859
Add into to results
benjaminflessner May 13, 2024
ec52476
Add social history mapping
benjaminflessner May 13, 2024
55d1820
Leave this for later
benjaminflessner May 13, 2024
66f3d18
Update EDD to be a component
benjaminflessner May 14, 2024
9c22387
Fix link
benjaminflessner May 18, 2024
a968e4d
Combine code rows
benjaminflessner May 18, 2024
96955ab
Add closing tags
benjaminflessner May 18, 2024
249463d
Add valueString to mapping
benjaminflessner May 28, 2024
f1082f4
Add note / links re US Core extensions
benjaminflessner May 28, 2024
ccb2b98
Add SDOH note
benjaminflessner May 28, 2024
dcb45f6
Add novel about EDD codes
benjaminflessner May 28, 2024
5756bbb
Add intention mapping; clean up nullFlavor mapping
benjaminflessner May 28, 2024
2152223
Fancy arrows!
benjaminflessner May 28, 2024
98a19d2
add example comparison images Smoking & Vitals HR
jlyle1 Jun 21, 2024
2869400
mod "click on here" to "click here" 6x
jlyle1 Jun 21, 2024
d76a784
added FC vitals draft
jlyle1 Jul 2, 2024
f442c8b
Rename image to fix sample
benjaminflessner Jul 9, 2024
e43ccbd
Add comment about telecom formatting from May 2024 connectathon
benjaminflessner Jul 9, 2024
58427f9
Add guardian mapping from May 2024 CAT
benjaminflessner Jul 9, 2024
9ed993b
Add patient to guardian paths
benjaminflessner Jul 9, 2024
7de3226
Move patientRole to XPath instead of every row
benjaminflessner Jul 9, 2024
eb4568f
Remove links to nonexistent (yet) pages
benjaminflessner Jul 9, 2024
d6e88c2
Add race-code text mapping
benjaminflessner Jul 9, 2024
316396f
Add religion
benjaminflessner Jul 9, 2024
0fa2fea
Add birthplaces from May 24 CAT
benjaminflessner Jul 9, 2024
11baeb7
Add language fields from May 24 CAT
benjaminflessner Jul 9, 2024
6a2897b
Merge remote-tracking branch 'origin/master' into 2024
benjaminflessner Jul 11, 2024
7c7bdfa
Guidance on code to Coding (text)
jlyle1 Jul 16, 2024
baa04c7
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Jul 16, 2024
ebc04c3
Add supply order mapping
benjaminflessner Jul 16, 2024
e45ce74
Fix supply link/labels. Add frequency range
benjaminflessner Jul 18, 2024
99d7aaf
loinc code typo
jlyle1 Jul 21, 2024
4b2fc77
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Jul 21, 2024
be4b289
Typos / content cleanup on new pages
benjaminflessner Jul 22, 2024
8c2672f
Add supporting observation
benjaminflessner Aug 13, 2024
764caed
Add Age Observation
benjaminflessner Aug 13, 2024
a3b5b81
Fix some spelling
benjaminflessner Aug 26, 2024
2130dce
Add approachSiteCode
benjaminflessner Sep 21, 2024
111707d
Add maxDoseQuantity
benjaminflessner Sep 21, 2024
41a9828
Add new table for Medication mapping
benjaminflessner Sep 21, 2024
0bf8b84
recorded -> recordedDate
benjaminflessner Sep 22, 2024
81ec26a
Move PQ link down to value
benjaminflessner Sep 22, 2024
0b92050
Map author to performer (follow meds/imm model)
benjaminflessner Sep 22, 2024
d25b68d
Add BP & PulseOx special cases to vitals
benjaminflessner Sep 22, 2024
986e428
Clean up Encounter Dx
benjaminflessner Sep 22, 2024
8af2056
Start draft of participations
benjaminflessner Sep 24, 2024
97d0f61
Finish tables and mapping guidance
benjaminflessner Sep 25, 2024
dd5ba41
added encounter status concept map
jlyle1 Sep 26, 2024
f0213a2
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Sep 26, 2024
ae9fbfe
Link to new encounter status concept map
benjaminflessner Sep 26, 2024
46e9003
Small typo/cleanup
benjaminflessner Sep 26, 2024
7812249
added text about missing maps
jlyle1 Sep 30, 2024
bf20b73
Update CF Notes mapping table
benjaminflessner Oct 14, 2024
e2f4cde
Remove CF -> FC links until those pages have content
benjaminflessner Oct 14, 2024
ec5a4f1
Fix broken internal links
benjaminflessner Oct 14, 2024
18d6140
Fix EncounterStatus concept map codes / displays
benjaminflessner Oct 14, 2024
8f49bfd
Update links from C-CDA 2024Jan ballot to published 3.0 URL
benjaminflessner Oct 14, 2024
1aa4b07
Update C-CDA links to 3.0 version directly (since "latest" could change)
benjaminflessner Oct 14, 2024
ba5570c
Draft change log
benjaminflessner Oct 14, 2024
4c724ab
Undo the bad display now that THO has fixed theirs.
benjaminflessner Oct 14, 2024
3d8fd5e
Remove ignored warnings that no longer occur
benjaminflessner Oct 14, 2024
c52f536
added guidance on LOINC lookup for categories
jlyle1 Oct 17, 2024
86e1258
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Oct 17, 2024
9d0ab49
Fix changelog / menu
benjaminflessner Oct 17, 2024
6ce9abc
Fix broken results table; update LOINC mapping after call
benjaminflessner Oct 17, 2024
87c9bfd
Add specimen
benjaminflessner Oct 17, 2024
35bc847
Create examples for Blood Pressure and PulseOx
benjaminflessner Oct 17, 2024
4138778
Fix some improper XML
benjaminflessner Oct 18, 2024
d6ce239
Build-in the highlighting
benjaminflessner Oct 18, 2024
c235e44
Fix the formatting of short attributes
benjaminflessner Oct 18, 2024
6ee93f1
added concept map for result status CF
jlyle1 Oct 21, 2024
99def55
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Oct 21, 2024
1437108
added FC result status concept map
jlyle1 Oct 21, 2024
51202c7
Add note on coding display
benjaminflessner Oct 21, 2024
6b39b5f
Remove images in prep for HTML-based highlighting
benjaminflessner Oct 21, 2024
a66aefd
Prep remaining CF pages for inline examples
benjaminflessner Oct 21, 2024
716a4e4
Add inline example for imms & procs
benjaminflessner Oct 21, 2024
1776231
Add highlighted medication example
benjaminflessner Oct 22, 2024
abea8c2
Add immunization mapping
benjaminflessner Oct 22, 2024
6c75c4a
Add note example
benjaminflessner Oct 22, 2024
45078ac
Add patient example
benjaminflessner Oct 22, 2024
07382f1
Fix CF Results map; couple other links
benjaminflessner Oct 24, 2024
763fee8
Split severity to make table readable
benjaminflessner Oct 24, 2024
1c9b2b7
Fix comment on result status map
benjaminflessner Oct 24, 2024
81b0470
Add note about contained
benjaminflessner Oct 24, 2024
80db525
Remove "1" LOINC
benjaminflessner Oct 24, 2024
223e8c3
Renamed "Illustrative example"
benjaminflessner Oct 24, 2024
c576537
Added appended to FC result status
jlyle1 Oct 24, 2024
b06d7ee
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Oct 24, 2024
5f1c95a
assigned result status map to sdoh
jlyle1 Oct 24, 2024
d08a3fa
Update procedure note for act & observation
benjaminflessner Oct 28, 2024
63f59cc
roadmap comment re uscdi, deprecation
jlyle1 Oct 28, 2024
03291d1
rename ConceptMap-FC-ResultStatus; remove partial
jlyle1 Oct 31, 2024
36ed7e8
removed extraneous value from obs status
jlyle1 Oct 31, 2024
47bdc40
Add vitals and results highlighted examples
benjaminflessner Nov 4, 2024
a0bb76d
Fix typo in concept map
benjaminflessner Nov 4, 2024
d329b2e
added social history examples for smoking
jlyle1 Nov 7, 2024
4e2af9c
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Nov 7, 2024
eb3c7ce
added scope/priority note to background
jlyle1 Nov 8, 2024
cefac1b
ballot edit tweaks to allergy, encounter, imm
jlyle1 Nov 14, 2024
0204c1c
links on comment paragraph
jlyle1 Nov 14, 2024
e9d2b48
Update examples for encounters/social hx
benjaminflessner Nov 14, 2024
238f9c7
Remove random UUID
benjaminflessner Nov 18, 2024
cd78093
Add some notes an example for organization
benjaminflessner Nov 18, 2024
fbc2e39
comment links; ballot note
jlyle1 Nov 18, 2024
ff6826d
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Nov 18, 2024
3919357
Bump version to 1.3
benjaminflessner Nov 21, 2024
83eab79
pubrequest updates
jlyle1 Nov 25, 2024
3be16fa
Merge branch '2024' of https://github.com/HL7/ccda-on-fhir into 2024
jlyle1 Nov 25, 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
16 changes: 16 additions & 0 deletions FHIR-us-ccda.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<artifact id="ConceptMap/CF-AddressUse" key="ConceptMap-CF-AddressUse" name="C-CDA to FHIR Address Use"/>
<artifact id="ConceptMap/CF-AdministrativeGender" key="ConceptMap-CF-AdministrativeGender" name="C-CDA to FHIR Adminmistrative Gender"/>
<artifact id="ConceptMap/CF-AllergyStatus" key="ConceptMap-CF-AllergyStatus" name="C-CDA to FHIR Allergy Status"/>
<artifact id="ConceptMap/CF-EncounterStatus" key="ConceptMap-CF-EncounterStatus" name="C-CDA to FHIR Encounter Status"/>
<artifact id="ConceptMap/CF-ImmunizationStatus" key="ConceptMap-CF-ImmunizationStatus" name="C-CDA to FHIR Immunization Status"/>
<artifact id="ConceptMap/CF-MedicationStatus" key="ConceptMap-CF-MedicationStatus" name="C-CDA to FHIR Medication Status"/>
<artifact id="ConceptMap/CF-NameUse" key="ConceptMap-CF-NameUse" name="C-CDA to FHIR NameUse"/>
Expand All @@ -36,6 +37,8 @@
<artifact id="ConceptMap/CF-Criticality" key="ConceptMap-CF-Criticality" name="CCDA Criticality to FHIR Criticality"/>
<artifact id="ConceptMap/CF-MedActivityMood" key="ConceptMap-CF-MedActivityMood" name="CCDA Medication Activity Mood to FHIR MedicationRequest.intent"/>
<artifact id="ConceptMap/CF-ConditionClinicalStatus" key="ConceptMap-CF-ConditionClinicalStatus" name="CCDA Problem Concern Status to FHIR Condition Clinical Status"/>
<artifact id="ConceptMap/CF-ResultReportStatus" key="ConceptMap-CF-ResultReportStatus" name="CCDA ResultStatus to FHIR DiagnosticReport status"/>
<artifact id="ConceptMap/CF-ResultStatus" key="ConceptMap-CF-ResultStatus" name="CCDA ResultStatus to FHIR Observation Status"/>
<artifact id="CapabilityStatement/CcdaOnFhirClient" key="CapabilityStatement-CcdaOnFhirClient" name="CCDA on FHIR Client"/>
<artifact id="CapabilityStatement/CcdaOnFhirServer" key="CapabilityStatement-CcdaOnFhirServer" name="CCDA on FHIR Server"/>
<artifact id="ConceptMap/CF-AllergyIntoleranceCategory" key="ConceptMap-CF-AllergyIntoleranceCategory" name="CCDA to FHIR Allergy Intolerance Category"/>
Expand Down Expand Up @@ -91,6 +94,7 @@
<artifact id="ConceptMap/FC-DataAbsentReasonNullFlavor" key="ConceptMap-FC-DataAbsentReasonNullFlavor" name="FHIR Data Absent Reason to C-CDA NullFlavor"/>
<artifact id="ConceptMap/FC-ImmunizationSite" key="ConceptMap-FC-ImmunizationSite" name="FHIR Immunization Site to C-CDA Immunization approachSiteCode"/>
<artifact id="ConceptMap/FC-ImmunizationRefusal" key="ConceptMap-FC-ImmunizationRefusal" name="FHIR Immunization Status Reason to C-CDA Immunization Refusal"/>
<artifact id="ConceptMap/FC-ResultStatus" key="ConceptMap-FC-ResultStatus" name="FHIR ResultStatus to C-CDA ResultStatus"/>
<artifact id="ConceptMap/FC-Severity" key="ConceptMap-FC-Severity" name="FHIR Severity to C-CDA Severity"/>
<artifact id="ConceptMap/FC-AddressUse" key="ConceptMap-FC-AddressUse" name="FHIR to C-CDA Address Use"/>
<artifact id="ConceptMap/FC-AdministrativeGender" key="ConceptMap-FC-AdministrativeGender" name="FHIR to C-CDA Adminmistrative Gender"/>
Expand Down Expand Up @@ -160,19 +164,31 @@
<page key="artifacts" name="Artifacts Summary"/>
<page key="background" name="Background"/>
<page key="CF-allergies" name="C-CDA to FHIR Allergies"/>
<page key="CF-encounters" name="C-CDA to FHIR Encounters"/>
<page key="CF-immunizations" name="C-CDA to FHIR Immunizations"/>
<page key="CF-medications" name="C-CDA to FHIR Medications"/>
<page key="CF-notes" name="C-CDA to FHIR Notes"/>
<page key="CF-participations" name="C-CDA to FHIR Participations"/>
<page key="CF-patient" name="C-CDA to FHIR Patient"/>
<page key="CF-problems" name="C-CDA to FHIR Problems"/>
<page key="CF-procedures" name="C-CDA to FHIR Procedures"/>
<page key="CF-results" name="C-CDA to FHIR Results"/>
<page key="CF-social" name="C-CDA to FHIR Social History"/>
<page key="CF-vitals" name="C-CDA to FHIR Vital Signs"/>
<page key="CF-index" name="C-CDA → FHIR Index"/>
<page key="mappingChangelog" name="Change Log"/>
<page key="downloads" name="Downloads"/>
<page key="FC-allergies" name="FHIR to C-CDA Allergies"/>
<page key="FC-encounters" name="FHIR to C-CDA Encounters"/>
<page key="FC-immunizations" name="FHIR to C-CDA Immunizations"/>
<page key="FC-medications" name="FHIR to C-CDA Medications"/>
<page key="FC-medications" name="FHIR to C-CDA Medications"/>
<page key="FC-patient" name="FHIR to C-CDA Patient"/>
<page key="FC-problems" name="FHIR to C-CDA Problems"/>
<page key="FC-procedures" name="FHIR to C-CDA Procedures"/>
<page key="FC-results" name="FHIR to C-CDA Results"/>
<page key="FC-social" name="FHIR to C-CDA Social History"/>
<page key="FC-vitals" name="FHIR to C-CDA Vital Signs"/>
<page key="FC-index" name="FHIR → C-CDA Index"/>
<page deprecated="true" key="Guidance" name="Guidance"/>
<page key="index" name="Home Page"/>
Expand Down
2 changes: 2 additions & 0 deletions _gencontinuous.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@ECHO OFF
CALL ./_genonce.bat -watch
2 changes: 2 additions & 0 deletions _gencontinuous.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./_genonce.sh -watch
2 changes: 2 additions & 0 deletions _genonce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ fi

echo "$txoption"

export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -Dfile.encoding=UTF-8"

publisher=$input_cache_path/$publisher_jar
if test -f "$publisher"; then
java -jar $publisher -ig . $txoption $*
Expand Down
219 changes: 219 additions & 0 deletions _updatePublisher.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
@ECHO OFF

SETLOCAL

SET dlurl=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar
SET publisher_jar=publisher.jar
SET input_cache_path=%CD%\input-cache\
SET skipPrompts=false

SET scriptdlroot=https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main
SET update_bat_url=%scriptdlroot%/_updatePublisher.bat
SET gen_bat_url=%scriptdlroot%/_genonce.bat
SET gencont_bat_url=%scriptdlroot%/_gencontinuous.bat
SET gencont_sh_url=%scriptdlroot%/_gencontinuous.sh
SET gen_sh_url=%scriptdlroot%/_genonce.sh
SET update_sh_url=%scriptdlroot%/_updatePublisher.sh

IF "%~1"=="/f" SET skipPrompts=y


ECHO.
ECHO Checking internet connection...
PING tx.fhir.org -4 -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
ECHO We're offline, nothing to do...
GOTO end

:isonline
ECHO We're online


:processflags
SET ARG=%1
IF DEFINED ARG (
IF "%ARG%"=="-f" SET FORCE=true
IF "%ARG%"=="--force" SET FORCE=true
SHIFT
GOTO processflags
)

FOR %%x IN ("%CD%") DO SET upper_path=%%~dpx

ECHO.
IF NOT EXIST "%input_cache_path%%publisher_jar%" (
IF NOT EXIST "%upper_path%%publisher_jar%" (
SET jarlocation="%input_cache_path%%publisher_jar%"
SET jarlocationname=Input Cache
ECHO IG Publisher is not yet in input-cache or parent folder.
REM we don't use jarlocation below because it will be empty because we're in a bracketed if statement
GOTO create
) ELSE (
ECHO IG Publisher FOUND in parent folder
SET jarlocation="%upper_path%%publisher_jar%"
SET jarlocationname=Parent folder
GOTO upgrade
)
) ELSE (
ECHO IG Publisher FOUND in input-cache
SET jarlocation="%input_cache_path%%publisher_jar%"
SET jarlocationname=Input Cache
GOTO upgrade
)

:create
IF DEFINED FORCE (
MKDIR "%input_cache_path%" 2> NUL
GOTO download
)

IF "%skipPrompts%"=="y" (
SET create=Y
) ELSE (
SET /p create="Ok? (Y/N) "
)
IF /I "%create%"=="Y" (
ECHO Will place publisher jar here: %input_cache_path%%publisher_jar%
MKDIR "%input_cache_path%" 2> NUL
GOTO download
)
GOTO done

:upgrade
IF "%skipPrompts%"=="y" (
SET overwrite=Y
) ELSE (
SET /p overwrite="Overwrite %jarlocation%? (Y/N) "
)

IF /I "%overwrite%"=="Y" (
GOTO download
)
GOTO done

:download
ECHO Downloading most recent publisher to %jarlocationname% - it's ~100 MB, so this may take a bit

FOR /f "tokens=4-5 delims=. " %%i IN ('ver') DO SET VERSION=%%i.%%j
IF "%version%" == "10.0" GOTO win10
IF "%version%" == "6.3" GOTO win8.1
IF "%version%" == "6.2" GOTO win8
IF "%version%" == "6.1" GOTO win7
IF "%version%" == "6.0" GOTO vista

ECHO Unrecognized version: %version%
GOTO done

:win10
CALL POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%dlurl%\",\"%jarlocation%\") } else { Invoke-WebRequest -Uri "%dlurl%" -Outfile "%jarlocation%" }

GOTO done

:win7
rem this may be triggering the antivirus - bitsadmin.exe is a known threat
rem CALL bitsadmin /transfer GetPublisher /download /priority normal "%dlurl%" "%jarlocation%"

rem this didn't work in win 10
rem CALL Start-BitsTransfer /priority normal "%dlurl%" "%jarlocation%"

rem this should work - untested
call (New-Object Net.WebClient).DownloadFile('%dlurl%', '%jarlocation%')
GOTO done

:win8.1
:win8
:vista
GOTO done



:done




ECHO.
ECHO Updating scripts
IF "%skipPrompts%"=="y" (
SET updateScripts=Y
) ELSE (
SET /p updateScripts="Update scripts? (Y/N) "
)
IF /I "%updateScripts%"=="Y" (
GOTO scripts
)
GOTO end


:scripts

REM Download all batch files (and this one with a new name)

SETLOCAL DisableDelayedExpansion



:dl_script_1
ECHO Updating _updatePublisher.sh
call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%update_sh_url%\",\"_updatePublisher.new.sh\") } else { Invoke-WebRequest -Uri "%update_sh_url%" -Outfile "_updatePublisher.new.sh" }
if %ERRORLEVEL% == 0 goto upd_script_1
echo "Errors encountered during download: %errorlevel%"
goto dl_script_2
:upd_script_1
start copy /y "_updatePublisher.new.sh" "_updatePublisher.sh" ^&^& del "_updatePublisher.new.sh" ^&^& exit


:dl_script_2
ECHO Updating _genonce.bat
call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gen_bat_url%\",\"_genonce.new.bat\") } else { Invoke-WebRequest -Uri "%gen_bat_url%" -Outfile "_genonce.bat" }
if %ERRORLEVEL% == 0 goto upd_script_2
echo "Errors encountered during download: %errorlevel%"
goto dl_script_3
:upd_script_2
start copy /y "_genonce.new.bat" "_genonce.bat" ^&^& del "_genonce.new.bat" ^&^& exit

:dl_script_3
ECHO Updating _gencontinuous.bat
call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gencont_bat_url%\",\"_gencontinuous.new.bat\") } else { Invoke-WebRequest -Uri "%gencont_bat_url%" -Outfile "_gencontinuous.bat" }
if %ERRORLEVEL% == 0 goto upd_script_3
echo "Errors encountered during download: %errorlevel%"
goto dl_script_4
:upd_script_3
start copy /y "_gencontinuous.new.bat" "_gencontinuous.bat" ^&^& del "_gencontinuous.new.bat" ^&^& exit


:dl_script_4
ECHO Updating _genonce.sh
call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gen_sh_url%\",\"_genonce.new.sh\") } else { Invoke-WebRequest -Uri "%gen_sh_url%" -Outfile "_genonce.sh" }
if %ERRORLEVEL% == 0 goto upd_script_4
echo "Errors encountered during download: %errorlevel%"
goto dl_script_5
:upd_script_4
start copy /y "_genonce.new.sh" "_genonce.sh" ^&^& del "_genonce.new.sh" ^&^& exit

:dl_script_5
ECHO Updating _gencontinuous.sh
call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gencont_sh_url%\",\"_gencontinuous.new.sh\") } else { Invoke-WebRequest -Uri "%gencont_sh_url%" -Outfile "_gencontinuous.sh" }
if %ERRORLEVEL% == 0 goto upd_script_5
echo "Errors encountered during download: %errorlevel%"
goto dl_script_6
:upd_script_5
start copy /y "_gencontinuous.new.sh" "_gencontinuous.sh" ^&^& del "_gencontinuous.new.sh" ^&^& exit



:dl_script_6
ECHO Updating _updatePublisher.bat
call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%update_bat_url%\",\"_updatePublisher.new.bat\") } else { Invoke-WebRequest -Uri "%update_bat_url%" -Outfile "_updatePublisher.new.bat" }
if %ERRORLEVEL% == 0 goto upd_script_6
echo "Errors encountered during download: %errorlevel%"
goto end
:upd_script_6
start copy /y "_updatePublisher.new.bat" "_updatePublisher.bat" ^&^& del "_updatePublisher.new.bat" ^&^& exit


:end


IF "%skipPrompts%"=="true" (
PAUSE
)
53 changes: 41 additions & 12 deletions _updatePublisher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,25 @@ while [ "$#" -gt 0 ]; do
case $1 in
-f|--force) FORCE=true ;;
-y|--yes) skipPrompts=true ; FORCE=true ;;
-s|--skip) skipPrompts=true ;;
*) echo "Unknown parameter passed: $1. Exiting"; exit 1 ;;
esac
shift
done

echo "Checking internet connection"
case "$OSTYPE" in
linux-gnu* ) ping tx.fhir.org -4 -c 1 -w 1000 >/dev/null ;;
darwin* ) ping tx.fhir.org -c 1 >/dev/null ;;
*) echo "unknown: $OSTYPE"; exit 1 ;;
esac
curl -sSf tx.fhir.org > /dev/null

if [ $? -ne 0 ] ; then
echo "Offline (or the terminology server is down), unable to update. Exiting"
exit 1
fi

if [ ! -d "$input_cache_path" ] ; then
if [ $skipPrompts != true ]; then
if [ $FORCE != true ]; then
echo "$input_cache_path does not exist"
message="create it?"
read -r -p "$message" response
else
else
response=y
fi
fi
Expand Down Expand Up @@ -90,14 +85,48 @@ if [[ $skipPrompts == false ]]; then
fi
read -r -p "$message" response
else
if [[ $FORCE == true ]]; then
response=y
fi
response=y
fi
if [[ $response =~ ^[yY].*$ ]]; then
if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then

echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit"
curl -L $dlurl -o "$jarlocation" --create-dirs
else
echo cancelled publisher update
fi

if [[ $skipPrompts != true ]]; then
message="Update scripts? (enter 'y' or 'Y' to continue, any other key to cancel)?"
read -r -p "$message" response
fi

if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then
echo "Downloading most recent scripts "

curl -L $update_bat_url -o /tmp/_updatePublisher.new
cp /tmp/_updatePublisher.new _updatePublisher.bat
rm /tmp/_updatePublisher.new

curl -L $gen_bat_url -o /tmp/_genonce.new
cp /tmp/_genonce.new _genonce.bat
rm /tmp/_genonce.new

curl -L $gencont_bat_url -o /tmp/_gencontinuous.new
cp /tmp/_gencontinuous.new _gencontinuous.bat
rm /tmp/_gencontinuous.new

curl -L $gencont_sh_url -o /tmp/_gencontinuous.new
cp /tmp/_gencontinuous.new _gencontinuous.sh
chmod +x _gencontinuous.sh
rm /tmp/_gencontinuous.new

curl -L $gen_sh_url -o /tmp/_genonce.new
cp /tmp/_genonce.new _genonce.sh
chmod +x _genonce.sh
rm /tmp/_genonce.new

curl -L $update_sh_url -o /tmp/_updatePublisher.new
cp /tmp/_updatePublisher.new _updatePublisher.sh
chmod +x _updatePublisher.sh
rm /tmp/_updatePublisher.new
fi
Loading