source: qrda/qds/qds2rdf.pl@ 937

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

intial conversion of QDS spreadsheets to cvs and rdf

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 #print "$name $_ " for @codes;
24 #print "\n";
25 if ($QDSid)
26 {
27 print "<rdf:Description rdf:about=\"";
28 print "/$QDSid\">\n";
29
30 print "<qds:NQF_id>$NQFid</qds:NQF_id>\n";
31 print "<qds:measure_name>$name</qds:measure_name>\n";
32 print "<qds:QDS_id>$QDSid</qds:QDS_id>\n";
33 print "<qds:standard_concept>$concept</qds:standard_concept>\n";
34 print "<qds:standard_category>$cat</qds:standard_category>\n";
35 print "<qds:QDS_data_type>$QDSdt</qds:QDS_data_type>\n";
36 print "<qds:standard_concept_id>$conceptid</qds:standard_concept_id>\n";
37 if ($taxonomy) {
38 print "<qds:standard_taxonomy>$taxonomy</qds:standard_taxonomy>\n";
39 }
40 if ($taxonomyver) {
41 print "<qds:standard_taxonomy_version>$taxonomyver</qds:standard_taxonomy_version>\n";
42 }
43 if ($QDSattr)
44 {
45 print "<qds:QDS_datatype_specific_attributes>$QDSattr</qds:QDS_datatype_specific_attributes>\n";
46 }
47 if ($codestr)
48 {
49 print "<qds:standard_code_list>$_</qds:standard_code_list>\n" for @codes;
50 }
51 print "</rdf:Description>\n";
52 }
53 }
54 @gpl1 = ();
55 @codes = ();
56}
57print "</rdf:RDF>\n";
Note: See TracBrowser for help on using the repository browser.