-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Win Swarr <USY6@CDC.gov> Co-authored-by: Le Yang <le.yang@gmail.com>
- Loading branch information
1 parent
4623227
commit 9816252
Showing
9 changed files
with
278 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
canary/ClientApp/src/components/tools/MessageFshConverter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import React, { Component } from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { Breadcrumb, Button, Container, Dimmer, Divider, Dropdown, Input, Form, Grid, Header, Icon, Loader, Menu, Message, Statistic, Transition } from 'semantic-ui-react'; | ||
import { Getter } from '../misc/Getter'; | ||
import { FHIRInfo } from '../misc/info/FHIRInfo'; | ||
import { Record } from '../misc/Record'; | ||
|
||
export class MessageFshConverter extends Component { | ||
displayName = MessageFshConverter.name; | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { ...this.props, record: null, fhirInfo: null, issues: null }; | ||
this.updateRecord = this.updateRecord.bind(this); | ||
} | ||
|
||
updateRecord(record, issues) { | ||
if (record && record.fhirInfo) { | ||
this.setState({ record: null, fhirInfo: null, issues: null }, () => { | ||
this.setState({ record: record, fhirInfo: record.fhirInfo, issues: [] }, () => { | ||
}); | ||
}) | ||
} else if (issues && issues.length > 0) { | ||
this.setState({ issues: issues, fhirInfo: null }); | ||
} | ||
} | ||
|
||
render() { | ||
return ( | ||
|
||
<React.Fragment> | ||
<Grid> | ||
<Grid.Row> | ||
<Breadcrumb> | ||
<Breadcrumb.Section as={Link} to="/"> | ||
Dashboard | ||
</Breadcrumb.Section> | ||
<Breadcrumb.Divider icon="right chevron" /> | ||
<Breadcrumb.Section>FHIR Message to FSH Converter</Breadcrumb.Section> | ||
</Breadcrumb> | ||
</Grid.Row> | ||
<Grid.Row> | ||
<Getter updateRecord={this.updateRecord} strict allowIje={false} showFsh={true} source={"MessageFshConverter"} /> | ||
</Grid.Row> | ||
{!!this.state.fhirInfo && ( | ||
<Grid.Row> | ||
<Container fluid> | ||
<Divider horizontal /> | ||
<Header as="h2" dividing id="step-2"> | ||
<Icon name="download" /> | ||
<Header.Content> | ||
Whole message content. | ||
<Header.Subheader> | ||
Enter or load the appropriate Connectathon test case data into your EDRS. | ||
</Header.Subheader> | ||
</Header.Content> | ||
</Header> | ||
<div className="p-b-15" /> | ||
<Record record={this.state.record} showSave lines={20} hideIje ijeOnly={true} showFsh /> | ||
</Container> | ||
</Grid.Row> | ||
)} | ||
<div className="p-b-15" /> | ||
{!!this.state.issues && this.state.issues.length > 0 && ( | ||
<Grid.Row> | ||
<Record record={null} issues={this.state.issues} showIssues /> | ||
</Grid.Row> | ||
)} | ||
</Grid> | ||
</React.Fragment> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.