source: qrda/qds/qds2rdf.pl@ 1401

Last change on this file since 1401 was 945, checked in by George Lilly, 14 years ago

removed leading blands from all standard_code elements

File size: 1.8 KB
Line 
1#!/usr/bin/perl -w
2print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
3print "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
4print " xmlns:qds=\"http://cms.gov/pqri/qds/\">\n";
5while(<STDIN>)
6{
7 my($line) = $_;
8 chomp($line);
9 chop($line);
10 $line =~ s/\"//g;
11 $line =~ s/\&/\&amp;/g;
12 $line =~ s/\</\&lt;/g;
13 $line =~ s/\>/\&gt;/g;
14 $line =~ s/\'/\&apos;/g;
15 $_ = $line;
16 push @gpl1, split(/\|/);
17 #print "$_\n" for @gpl1;
18 my ($NQFid, $name, $QDSid, $concept, $cat, $QDSdt, $conceptid, $taxonomy, $taxonomyver, $codestr, $QDSattr) = @gpl1;
19 if ($NQFid ne "NQF_id")
20 {
21 $_ = $codestr;
22 if ($codestr) {push @codes, split(/\,/)};
23 $_ =~ s/^ +//g for @codes;
24 #print "$name $_ " for @codes;
25 #print "\n";
26 if ($QDSid)
27 {
28 print "<rdf:Description rdf:about=\"";
29 print "/$QDSid\">\n";
30
31 print "<qds:NQF_id>$NQFid</qds:NQF_id>\n";
32 print "<qds:measure_name>$name</qds:measure_name>\n";
33 print "<qds:QDS_id>$QDSid</qds:QDS_id>\n";
34 print "<qds:standard_concept>$concept</qds:standard_concept>\n";
35 print "<qds:standard_category>$cat</qds:standard_category>\n";
36 print "<qds:QDS_data_type>$QDSdt</qds:QDS_data_type>\n";
37 print "<qds:standard_concept_id>$conceptid</qds:standard_concept_id>\n";
38 if ($taxonomy) {
39 print "<qds:standard_taxonomy>$taxonomy</qds:standard_taxonomy>\n";
40 }
41 if ($taxonomyver) {
42 print "<qds:standard_taxonomy_version>$taxonomyver</qds:standard_taxonomy_version>\n";
43 }
44 if ($QDSattr)
45 {
46 print "<qds:QDS_datatype_specific_attributes>$QDSattr</qds:QDS_datatype_specific_attributes>\n";
47 }
48 if ($codestr)
49 {
50 print "<qds:standard_code_list>$_</qds:standard_code_list>\n" for @codes;
51 }
52 print "</rdf:Description>\n";
53 }
54 }
55 @gpl1 = ();
56 @codes = ();
57}
58print "</rdf:RDF>\n";
Note: See TracBrowser for help on using the repository browser.