Skip to content

Commit

Permalink
Merge branch 'signs_and_symptoms' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JonKernPA committed Jul 11, 2012
2 parents 906fde7 + c2f4a55 commit c0357a6
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 33 deletions.
26 changes: 25 additions & 1 deletion conf/nemsis_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3718,8 +3718,32 @@ E10_12:
data_type: text
field_values: ~
is_multi_entry: 0
name: Poistion Of Patient In The Seat Of Vehicle
name: Position Of Patient In The Seat Of Vehicle
node: E10_12
E10_13:
allow_null: 1
data_entry_method: '~'
data_type: text
field_values: ~
is_multi_entry: 0
name: Injury Location Description
node: E10_13
E10_14:
allow_null: 1
data_entry_method: '~'
data_type: text
field_values: ~
is_multi_entry: 0
name: Injury Date
node: E10_14
E10_15:
allow_null: 1
data_entry_method: '~'
data_type: text
field_values: ~
is_multi_entry: 0
name: Injury Detail Description
node: E10_15
E11_01:
allow_null: 1
data_entry_method: single-choice National Element
Expand Down
4 changes: 4 additions & 0 deletions lib/nemsis/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ def concat(*elements)
concat_with(elements, ' ')
end

def concat_with_hyphen(*elements)
concat_with(elements, ' - ')
end

def concat_with_comma(*elements)
concat_with(elements, ', ')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/nemsis/renderer/wake_med/templates/runsheet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
start_table title, 6 %>
<tbody>
<!-- Primary Impression, Anatomical Position, Injury -->
<%= row( {'Primary Impression' => "concat('E09_19')"}, 'E09_11', {'Injury' => "concat_with_comma('E10_11', 'E10_02', 'E10_03')"} )%>
<%= row( {'Primary Impression' => "concat('E09_19')"}, 'E09_11', {'Injury' => "concat_with_hyphen('E10_11', 'E10_15', 'E10_13', 'E10_14')"} )%>
<!-- Secondary Impression, Chief Complaint (Dur), Medical/Trauma -->
<% chief_complaint = @parser.has_content('E09_05') ? "#{@parser.E09_05} &ndash; Dur. #{@parser.E09_06} #{@parser.E09_07}" : '&nbsp;' %>
<%= row( {'Secondary Impression' => "E09_20"}, {'Chief Complaint' => chief_complaint}, {'Medical/Trauma' => "parse_value_of('MedicalTrauma')"} )%>
Expand Down
8 changes: 7 additions & 1 deletion spec/data/everything_patient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,13 @@
<E09_20>Trying to one-up Jacka$$</E09_20>
</E09>
<E10>
<E10_01>-20</E10_01>
<E10_01>9550</E10_01>
<E10_02>2030</E10_02>
<E10_03>2035</E10_03>
<E10_11>Fall</E10_11>
<E10_13>Home</E10_13>
<E10_14>2012-02-27</E10_14>
<E10_15>Fall from other slipping, tripping or stumbling</E10_15>
</E10>
<E11>
<E11_01>2240</E11_01>
Expand Down
55 changes: 25 additions & 30 deletions spec/nemsis/renderer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
write_html_file("everything_patient", "fancy", html)
end

#=begin
=begin
it 'should render test xml file' do
sample_xml_file = File.expand_path('../../data/priscilla.xml', __FILE__)
xml_str = File.read(sample_xml_file)
Expand All @@ -165,7 +165,7 @@
html = r.render_fancy
write_html_file("test", "fancy", html)
end
#=end
=end

after :all do
WRITE_HTML_FILE = false
Expand Down Expand Up @@ -208,9 +208,9 @@
@plain_html.should_not =~ /<td ><font size='2'><\/font><\/td>/
end

it 'write to html file' do
write_html_file('sample', 'simple', @plain_html)
end
#it 'write to html file' do
# write_html_file('sample', 'simple', @plain_html)
#end
end

context 'fancy HTML' do
Expand All @@ -219,9 +219,9 @@
@fancy_html.should =~ /<STYLE/
end

it 'write to html file' do
write_html_file('sample', 'fancy', @fancy_html)
end
#it 'write to html file' do
# write_html_file('sample', 'fancy', @fancy_html)
#end
end
end

Expand Down Expand Up @@ -261,6 +261,7 @@
end

end

context 'Clinical Impression Injury' do
let(:p) {
xml_str = <<XML
Expand All @@ -270,15 +271,13 @@
<Header>
<Record>
<E10>
<E10_01>9595</E10_01>
<E10_01>9550</E10_01>
<E10_02>2030</E10_02>
<E10_03>2035</E10_03>
<E10_06_0>
<E10_06>1</E10_06>
<E10_07>2165</E10_07>
</E10_06_0>
<E10_11>Motorized Vehicle Accident</E10_11>
<E10_12>Right Front</E10_12>
<E10_11>Fall</E10_11>
<E10_13>Home</E10_13>
<E10_14>2012-02-27</E10_14>
<E10_15>Fall from other slipping, tripping or stumbling</E10_15>
</E10>
</Record>
</Header>
Expand All @@ -289,15 +288,12 @@
let(:r) { Nemsis::Renderer::WakeMed::HTML.new(p)}
let(:html) {r.render}

# "concat('E10_11', 'E10_02', 'E10_03')"
# 9595: Motor Vehicle traffic accident (E81X.0)
# 2030: Unintentional
# 2035: Blunt
# Motorized Vehicle Accident
describe 'Injury values' do
it('should have Injury label') {html.should =~ /Injury/}
it('should have values') {html.should =~ /Motorized Vehicle Accident, Unintentional, Blunt/}
#it('write to html file') { saved_flag=WRITE_HTML_FILE;WRITE_HTML_FILE=true; write_html_file('injury', 'simple', html);WRITE_HTML_FILE=saved_flag}
describe 'various signs and symptom values' do
#it('write to html file') {WRITE_HTML_FILE=true; write_html_file('symptoms', 'simple', html)}
it('should have section') {html.should =~ /Clinical Impression/}
it('should have details') {html.should =~ /Fall from other slipping, tripping or stumbling/}
it('should have date') {html.should =~ /2012-02-27/}
it('should have location') {html.should =~ /Home/}
end

end
Expand Down Expand Up @@ -483,8 +479,7 @@
html.should =~ /95.5 E/ # 35.28 deg C
end

it('write to html file') { saved_flag=WRITE_HTML_FILE;WRITE_HTML_FILE=true; write_html_file('vital_signs', 'simple', html);WRITE_HTML_FILE=saved_flag}

#it('write to html file') { saved_flag=WRITE_HTML_FILE;WRITE_HTML_FILE=true; write_html_file('vital_signs', 'simple', html);WRITE_HTML_FILE=saved_flag}

end

Expand Down Expand Up @@ -591,7 +586,7 @@

it 'should have a Flow Chart section' do
fancy_html.should =~ /Flow Chart/i
write_html_file('flow_chart', 'fancy', fancy_html)
#write_html_file('flow_chart', 'fancy', fancy_html)
end

it 'should not have a Trauma section' do
Expand Down Expand Up @@ -682,7 +677,7 @@

it 'should have a ECG section' do
fancy_html.should =~ /ECG/i
write_html_file('ecg', 'fancy', fancy_html)
#write_html_file('ecg', 'fancy', fancy_html)
end

it 'should not have a Trauma section' do
Expand Down Expand Up @@ -730,8 +725,8 @@
let(:html) { r.render }

it 'should have the special section' do
WRITE_HTML_FILE = true
write_html_file('personal_items', 'simple', html)
#WRITE_HTML_FILE = true
#write_html_file('personal_items', 'simple', html)
html.should =~ /Personal Items/
end
it 'should have the first entry' do
Expand Down

0 comments on commit c0357a6

Please sign in to comment.