-
Notifications
You must be signed in to change notification settings - Fork 0
/
PatientName.cpp
37 lines (26 loc) · 1.06 KB
/
PatientName.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "PatientName.hpp"
#include "imebra.hpp"
#include "Arguments.hpp"
using namespace bindings;
Nan::Persistent<v8::Function> PatientName::constructor;
NAN_METHOD(PatientName::New){
PatientName* p = new PatientName();
p->Wrap(info.This());
info.GetReturnValue().Set(info.This());
}
NAN_METHOD(PatientName::GetAlphabeticRepresentation) {
UNWRAP(info.This(),PatientName,p);
info.GetReturnValue().Set(Nan::New(p->value->getAlphabeticRepresentation()).ToLocalChecked());
}
PatientName::PatientName(): value(nullptr){}
PatientName::~PatientName() {
delete value;
}
void PatientName::Init(v8::Local<v8::Object> exports){
auto tpl = Nan::New<v8::FunctionTemplate>(New);
tpl->SetClassName(Nan::New("PatientName").ToLocalChecked());
tpl->InstanceTemplate()->SetInternalFieldCount(1);
Nan::SetPrototypeMethod(tpl,"getAlphabeticRepresentation",GetAlphabeticRepresentation);
constructor.Reset(Nan::GetFunction(tpl).ToLocalChecked());
Nan::Set(exports,Nan::New("PatientName").ToLocalChecked(),Nan::GetFunction(tpl).ToLocalChecked());
}