53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/hqmf-parser/parser.rb', line 53
def parse_fields(xml_contents)
doc = HQMF1::Document.parse(xml_contents)
type = doc.at_xpath('//cda:code/@code').value
result = {}
if type == '57024-2'
id = doc.at_xpath('//cda:id/@root').value.upcase
set_id = doc.at_xpath('//cda:setId/@root').value.upcase
version_number = doc.at_xpath('//cda:versionNumber/@value').value.to_i
title = doc.at_xpath('cda:QualityMeasureDocument/cda:title').inner_text
description = doc.at_xpath('cda:QualityMeasureDocument/cda:text').inner_text
result = {'id' => id, 'set_id' => set_id, 'version' => version_number, 'title' => title, 'description' => description}
end
result
end
|