#!/bin/csh

set TARGET=/tmp/cda

if (-e $TARGET) rm -r $TARGET

mkdir $TARGET
mkdir $TARGET/cda-gen

set SUFFIX=_generated.xml

foreach cda (	 APE APHP APS CRD CTNN DSC EDPN EDR EHCP ENS ETC IC LDHP \
	LDS MCHCGS MCHHBS MDS NDS NN PPOC PPVS PRPHCA TN \
	XDSMSDischarge XDSMSReferral XPHRExtract XPHRUpdate \
	)
  set X=$cda$SUFFIX
  if (! -e cda-gen/$X) then
    echo Could not find cda-gen/$cda.xml
    exit
  endif
  cp cda-gen/$X $TARGET/cda-gen
end

mkdir $TARGET/body
foreach xml(body/*xml)
 cp $xml $TARGET/body
end

mkdir $TARGET/header
foreach xml(header/*xml)
 cp $xml $TARGET/header
end

mkdir $TARGET/xsl-eval
foreach xsl(xsl-eval/*xsl)
 cp $xsl $TARGET/xsl-eval
end

mkdir $TARGET/for_evaluation
foreach e(for_evaluation/*xml)
 cp $e $TARGET/for_evaluation 
end

mkdir $TARGET/html-eval
foreach h(html-eval/*html)
 cp $h $TARGET/html-eval
end

#cp all_sections.xml $TARGET
cp PCC_SampleCDA_01.xml $TARGET
cp NA2011_CDA_Evaluation.xpr $TARGET
 

