hapi-fhir/sync.sh

39 lines
2.3 KiB
Bash
Executable File

#!/bin/sh
set -e
FHIRTRUNK=~/workspace/fhir/trunk
# Resource Definitions
rm hapi-tinder-plugin/src/main/resources/res/dstu2/*
for i in $(find $FHIRTRUNK/build/source -name *-spreadsheet.xml | egrep "/[a-z0-9]+-spreadsheet"); do cp -v $i hapi-tinder-plugin/src/main/resources/res/dstu2/; done
# Datatype Definitions
rm hapi-tinder-plugin/src/main/resources/dt/dstu2/*
for i in $(find $FHIRTRUNK/build/source/datatypes | grep xml | grep -v spreadsheet | grep -v -); do cp -v $i hapi-tinder-plugin/src/main/resources/dt/dstu2/; done
# Compartments
cp ~/workspace/fhir/trunk/build/source/compartments.xml hapi-tinder-plugin/src/main/resources/compartment/
# ValueSets
cp $FHIRTRUNK/build/publish/valuesets.xml hapi-fhir-validation-resources-dstu2/src/main/resources/org/hl7/fhir/instance/model/valueset/
cp $FHIRTRUNK/build/publish/v3-codesystems.xml hapi-fhir-validation-resources-dstu2/src/main/resources/org/hl7/fhir/instance/model/valueset/
cp $FHIRTRUNK/build/publish/v2-tables.xml hapi-fhir-validation-resources-dstu2/src/main/resources/org/hl7/fhir/instance/model/valueset/
# Profiles
touch ./hapi-fhir-validation-resources-dstu2/target/classes/org/hl7/fhir/instance/model/profile/_.xml
rm ./hapi-fhir-validation-resources-dstu2/target/classes/org/hl7/fhir/instance/model/profile/*.xml
for i in $(find $FHIRTRUNK/build/publish | grep -E "publish\/[a-z]+\.profile.xml$"); do echo $i; cp $i hapi-fhir-validation-resources-dstu2/src/main/resources/org/hl7/fhir/instance/model/profile/; done
# Schematron
rm ./hapi-fhir-validation-resources-dstu2/target/classes/org/hl7/fhir/instance/model/schema/*.sch
for i in $(ls $FHIRTRUNK/build/publish/*.sch | grep -v -); do cp -v $i ./hapi-fhir-validation-resources-dstu2/target/classes/org/hl7/fhir/instance/model/schema/; done
# Schema
cp $FHIRTRUNK/build/publish/fhir-single.xsd ./hapi-fhir-validation-resources-dstu2/target/classes/org/hl7/fhir/instance/model/schema/
cp $FHIRTRUNK/build/publish/fhir-xhtml.xsd ./hapi-fhir-validation-resources-dstu2/target/classes/org/hl7/fhir/instance/model/schema/
cp $FHIRTRUNK/build/publish/xml.xsd ./hapi-fhir-validation-resources-dstu2/target/classes/org/hl7/fhir/instance/model/schema/
#find hapi-tinder-plugin/src/main/resources/res/dstu2 | sed "s|.*/|<baseResourceName>|" | sed "s/-spread.*/<\/baseResourceName>/" | sort