Mentions légales du service

Skip to content
Snippets Groups Projects
eHDSIGeneration.sh 1.5 KiB
Newer Older
#!/bin/bash

#Colors definitions for terminal
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
NC='\033[0m'

printf "Please enter a path to your BBR (Absolute Path) : "
read -r bbrPath
echo -e  $bbrPath
isAbsPath=`echo "${bbrPath}" | grep ^/.* | wc -l`
if [ $isAbsPath -eq 0 ]; then
    echo -e "${RED}[ ${bbrPath} ] is not an absolute path"
    exit 0
fi
if [ ! -f $bbrPath ]; then
    echo -e "${RED}[ ${bbrPath} ] is not a file or doesn't exist !"
    exit 0
fi

printf "Please choose the kind of validator you want to generate: \n"
printf "\t 1- Pivot (L3)\n"
printf "\t 2- Scanned (L1)\n"
printf "\t 3- Friendly\n"
printf "your choice: "
read -r choice

if [ $choice -gt 3 -o $choice -lt 1 ]; then
  echo "Wrong choice, please repeat and choose between 1 and 3"
  exit 0
fi

case $choice in

  1)
    echo "generating pivot"
    validator="pivot"
    ;;
  2)
    echo "generation scanned"
     validator="scanned"
    ;;
  3)
    echo "generation friendly"
    validator="friendly"
    ;;
esac

_currDate=`date +%Y-%m-%d-%H-%M-%S`
printf "Please enter the folder name of your validator: (output-${validator}-${_currDate})?"
read -r folderName
if [ -z $folderName ]; then
  folderName="output-${validator}-${_currDate}"
fi;

/bin/bash generateValidator.sh --BBR_LINK=$bbrPath --OUTPUT_FOLDER=$folderName --VALIDATOR_NAME=$validator --IGNORE_TEMPLATEID_REQUIREMENTS="false" --ROOT_CLASS_NAME="net.ihe.gazelle.cdaepsos3.POCDMT000040ClinicalDocument" --HL7TEMP_CDACONFFOLDERNAME="cdaepsos"


#/bin/bash generateValidator.sh