Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

headerLevel.js module throws TypeError exceptions #26

Open
JohnWMay opened this issue Mar 24, 2016 · 13 comments
Open

headerLevel.js module throws TypeError exceptions #26

JohnWMay opened this issue Mar 24, 2016 · 13 comments

Comments

@JohnWMay
Copy link

The headerLevel.js module throws:
.../node_modules/blue-button-generate/lib/headerLevel.js:24
return input.substring(0, 1);
^
TypeError: undefined is not a function

as well as on line 36.

I was able to generate the XML version by changing "input" to "input.code" on each of these lines: 24, and 36. Is this accurate? It worked.

@jsachs
Copy link
Contributor

jsachs commented Mar 26, 2016

Hi @JohnWMay,

You shouldn't have to change anything to get the module to work--we've been using the source file in question for the past 10 months without issue. A few questions:

  1. Is the issue happening for both gender and marital status sections independently? In other words, if you make the change that avoids the error at line 24, can you still get the other error to occur?
  2. What does your gender and marital status data look like?

@webmaven
Copy link

webmaven commented Jul 3, 2016

@JohnWMay , is this still an issue?

@JohnWMay
Copy link
Author

JohnWMay commented Jul 5, 2016

Hi.

I can’t follow up with this issue, to give you a definite answer, as I was re-assigned to other work back then.

John W. May
571-247-5669

From: Michael R. Bernstein [mailto:[email protected]]
Sent: Sunday, July 03, 2016 2:38 AM
To: amida-tech/blue-button-generate
Cc: May, John (CACI); Mention
Subject: [EXTERNAL] Re: [amida-tech/blue-button-generate] headerLevel.js module throws TypeError exceptions (#26)

@JohnWMayhttps://github.com/JohnWMay , is this still an issue?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/26#issuecomment-230138397, or mute the threadhttps://github.com/notifications/unsubscribe/AFdGwC-bbeDdf0BSiGgbm012Gr4uZXGWks5qR1jlgaJpZM4H4Pfz.

@webmaven
Copy link

Hmm. No commits to this repo since February. Is it still being maintained?

@jsachs
Copy link
Contributor

jsachs commented Oct 23, 2016

@webmaven we still maintain the repo, we just haven't done active development on it in a while.

@sjpadgett
Copy link

When parsing a document the gender and marital status are code array consisting of code and display name where headerLevel.js:24 (and other's) look for a string. So while using supplied json will work because gender object is not complete but only a string(display name), normal ccd parsed json will not.
From document parse
{ name: 'Female',
code: 'F',
code_system_name: 'HL7 AdministrativeGender' }
Now, when only the gender json string (Female) is supplied the generator will format the xml correctly into required format. Probably best solution is to test the input to determine type.

@jsachs
Copy link
Contributor

jsachs commented Feb 14, 2017

@sjpadgett I'm not quite sure what you're saying. Are you saying that when code is missing the parser will not work? I haven't worked on this repo in a while, but I believe that is expected behavior--the parser should value the code as the source of truth, not the name field.

@sjpadgett
Copy link

What i'm saying is that when a xml document is parsed the resolved json gender is an array of
{ name: 'Female',
code: 'F',
code_system_name: 'HL7 AdministrativeGender' }
as it should be however, if you take that same json from the parsed document and tried to generate a new document then the template routine at line 24 is looking for a string value not an object/array.
Your json samples only supply a string for gender/marital status therefore it works no problem.
So if you parse a document then edited json and tried to render that same document, it will fail.

@sjpadgett
Copy link

Also, I have dumped the item value at that location and indeed it is an array of name,code,code_system

@sjpadgett
Copy link

If anyone who is monitoring this repo has any tools that help populate the bb model for generating document such as empty json arrays or routines for doing so, I may be able to give something back to ya as I progress.

@jsachs
Copy link
Contributor

jsachs commented Feb 14, 2017

@sjpadgett
Copy link

Thanks jsachs, I've seen them and have a pretty good working knowledge of all the tools but I'm at the point of populating patient data to create documents and was wondering how others handle this.
Kudos on a very well done project and thanks for sharing.

@jsachs
Copy link
Contributor

jsachs commented Feb 14, 2017

There are some sample documents at http://developers.amida-tech.com/document_model.html. Is this what you're looking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants