@front10/healthcare-book
Advanced tools
Comparing version 1.2.2 to 1.3.1
{ | ||
"name": "@front10/healthcare-book", | ||
"version": "1.2.2", | ||
"version": "1.3.1", | ||
"description": "Set of healthcare angularjs components ready to integrate with your apps.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,2 +6,3 @@ /** | ||
import gql from "graphql-tag"; | ||
import moment from 'moment'; | ||
@@ -55,2 +56,7 @@ import doctorList from '../../../stories/mock/doctorList'; | ||
rank | ||
carrier{ | ||
id | ||
name | ||
rank | ||
} | ||
} | ||
@@ -64,3 +70,8 @@ } | ||
} = result.data; | ||
resolve([...getAllmedicalPlane.map(item => Object.assign({}, item))]); | ||
let plans = [ | ||
...getAllmedicalPlane.map(item => Object.assign({ | ||
carrierid: item.carrier.id | ||
}, item)) | ||
]; | ||
resolve(plans); | ||
}).catch(error => { | ||
@@ -95,3 +106,2 @@ reject(error); | ||
}); | ||
// resolve(address); | ||
}); | ||
@@ -101,3 +111,2 @@ } | ||
return new Promise((resolve, reject) => { | ||
// resolve(doctorList); | ||
this.apollo | ||
@@ -131,10 +140,3 @@ .query({ | ||
rating | ||
medicalPlane { | ||
id | ||
name | ||
rank | ||
carrier { | ||
id | ||
} | ||
} | ||
procedure { | ||
@@ -149,3 +151,3 @@ id | ||
} | ||
} | ||
} | ||
` | ||
@@ -160,18 +162,18 @@ }) | ||
doctor: { | ||
name: `${item.firstName} ${item.lastName} ${item.title}`, | ||
synthesis: item.details, | ||
address: ``, | ||
stars: item.rating, | ||
name: `${item.firstName} ${item.lastName}, ${item.title}`, | ||
synthesis: (item.details) ? item.details : '', | ||
address: this.formatedAddress((item.address[0]) ? item.address[0] : {}), | ||
stars: (item.rating) ? item.rating : '', | ||
profession: '', | ||
image: item.image, | ||
image: (item.image) ? item.image : '', | ||
gender: item.gender, | ||
}, | ||
isSponsored: false, | ||
// carriers: [...item.carriers], | ||
procedures: [...item.procedure.map(item => Object.assign({}, item))], | ||
languages: [...item.language.map(item => Object.assign({}, item))], | ||
address: [...item.address.map(item => Object.assign({}, item))], | ||
horary: this.createHorary(item.horary), | ||
carriers: (item.carriers) ? [...item.carriers] : [], | ||
procedures: (item.procedure) ? [...item.procedure.map(item => Object.assign({}, item))] : [], | ||
languages: (item.language) ? [...item.language.map(item => Object.assign({}, item))] : [], | ||
address: (item.address) ? [...item.address.map(item => Object.assign({}, item))] : [], | ||
} | ||
}) | ||
// console.log('this is the data doctorlist that was formated',doctors); | ||
resolve(doctors); | ||
@@ -184,2 +186,18 @@ }).catch(error => { | ||
} | ||
formatedAddress(address) { | ||
return (address) ? ` | ||
${(address.country)?address.country:''}, | ||
${(address.state)?address.state:''}, | ||
${(address.city)?address.city:''}, | ||
${(address.streetAddress)?address.streetAddress:''}, | ||
${(address.zip)?address.zip:''} | ||
` : ''; | ||
} | ||
createHorary(itemhorary) { | ||
let horary = {}; | ||
itemhorary.map((item) => { | ||
if (item.date) horary[moment(item.date[0]).format('YYYY-MM-DD')] = item.date; | ||
}); | ||
return horary; | ||
} | ||
getDoctorFilter() { | ||
@@ -285,2 +303,3 @@ const defaultdoctorListFilter = { | ||
return { | ||
...item, | ||
name: `${item.firstName} ${item.lastName}`, | ||
@@ -292,4 +311,2 @@ city: item.address.city, | ||
})]; | ||
// console.log('this are de doctors in Doctor or condition: ', doctors); | ||
let procedure = getAllProcedures.map(item => { | ||
@@ -300,7 +317,5 @@ return { ...item, | ||
}) | ||
// console.log('this are de procedure in Doctor or condition: ', procedure); | ||
let response = [...doctors, ...procedure] | ||
// console.log('this are de response in Doctor or condition: ', response); | ||
resolve(response) | ||
}).catch(error=>{ | ||
}).catch(error => { | ||
reject(error) | ||
@@ -331,30 +346,78 @@ }) | ||
}) { | ||
const doctorid = (selectedDoctor && selectedDoctor.type === "doctor") ? selectedDoctor.id : 0; | ||
const carrierid = (selectedPlan) ? selectedPlan.carrierid : 0; | ||
const zipcode = (selectedAddress) ? selectedAddress.zip : 0; | ||
const procedureid = (selectedDoctor && selectedDoctor.type === "condition_procedure") ? selectedDoctor.id : 0; | ||
return new Promise((resolve, reject) => { | ||
let doctorListCopy = [...doctorList]; | ||
this.apollo | ||
.query({ | ||
query: gql ` | ||
query { | ||
getFilteredDoctors(doctorid: ${doctorid}, carrierid: ${carrierid}, zipcode: ${zipcode}, procedureid: ${procedureid}) { | ||
id | ||
firstName | ||
lastName | ||
age | ||
title | ||
gender | ||
details | ||
address { | ||
id | ||
city | ||
zip | ||
latitude | ||
longitude | ||
state | ||
streetAddress | ||
country | ||
} | ||
horary { | ||
id | ||
date | ||
} | ||
image | ||
rating | ||
procedure { | ||
id | ||
name | ||
} | ||
language { | ||
id | ||
name | ||
} | ||
} | ||
} | ||
` | ||
}) | ||
.then(result => { | ||
const { | ||
getFilteredDoctors | ||
} = result.data; | ||
if (selectedPlan) { | ||
const doctorListFiltered = doctorListCopy.filter(item => { | ||
const carriersFilter = item.carriers.find(element => element.id === selectedPlan.carrierid); | ||
return (carriersFilter) ? item : null; | ||
}); | ||
doctorListCopy = [...doctorListFiltered]; | ||
} | ||
if (selectedAddress) { | ||
const doctorListFiltered = doctorListCopy.filter(item => { | ||
const addressFilter = item.address.find(element => element.zip === selectedAddress.zip); | ||
return (addressFilter) ? item : null; | ||
}); | ||
doctorListCopy = [...doctorListFiltered]; | ||
} | ||
if (selectedDoctor) { | ||
const doctorListFiltered = doctorListCopy.filter(item => { | ||
return (item.doctor.name === selectedDoctor.name) ? item : null; | ||
let doctors = getFilteredDoctors.map(item => { | ||
return { | ||
doctor: { | ||
name: `${item.firstName} ${item.lastName} ${item.title}`, | ||
synthesis: (item.details) ? item.details : '', | ||
address: this.formatedAddress((item.address[0]) ? item.address[0] : {}), | ||
stars: (item.rating) ? item.rating : '', | ||
profession: '', | ||
image: (item.image) ? item.image : '', | ||
gender: item.gender, | ||
}, | ||
isSponsored: false, | ||
horary: this.createHorary(item.horary), | ||
carriers: (item.carriers) ? [...item.carriers] : [], | ||
procedures: (item.procedure) ? [...item.procedure.map(item => Object.assign({}, item))] : [], | ||
languages: (item.language) ? [...item.language.map(item => Object.assign({}, item))] : [], | ||
address: (item.address) ? [...item.address.map(item => Object.assign({}, item))] : [], | ||
} | ||
}) | ||
resolve(doctors); | ||
}).catch(error => { | ||
reject(error); | ||
}); | ||
doctorListCopy = [...doctorListFiltered]; | ||
} | ||
resolve(doctorListCopy); | ||
reject({ | ||
// error: "" | ||
}); | ||
}) | ||
@@ -361,0 +424,0 @@ } |
@@ -1,2 +0,1 @@ | ||
class appointmenFinderController { | ||
@@ -20,3 +19,3 @@ constructor(appointmentFinderService, cfpLoadingBar) { | ||
this.selectedPage = 1 | ||
this.elementsForPage = 2 | ||
this.elementsForPage = 5 | ||
@@ -36,3 +35,3 @@ // Update values | ||
}).catch(() => { | ||
// console.log('Inespected error', error); | ||
// console.log('Inespected error', error); | ||
}); | ||
@@ -44,3 +43,3 @@ } | ||
}).catch(() => { | ||
// console.log('Inespected error', error); | ||
// console.log('Inespected error', error); | ||
}); | ||
@@ -52,10 +51,13 @@ } | ||
}).catch(() => { | ||
// console.log('Inespected error', error); | ||
// console.log('Inespected error', error); | ||
}); | ||
} | ||
getDoctorList() { | ||
this.cfpLoadingBar.start(); | ||
this.appointmentFinderService.getDoctorList().then(doctorList => { | ||
this.doctorList = doctorList; | ||
this.cfpLoadingBar.complete(); | ||
}).catch(() => { | ||
// console.log('Inespected error', error); | ||
this.cfpLoadingBar.complete(); | ||
// console.log('Inespected error', error); | ||
}); | ||
@@ -67,8 +69,12 @@ } | ||
}).catch(() => { | ||
// console.log('Inespected error', error); | ||
// console.log('Inespected error', error); | ||
}); | ||
} | ||
getDoctorOrConditionList() { | ||
this.cfpLoadingBar.start(); | ||
this.appointmentFinderService.getDoctorOrConditionList().then(doctorOrConditionList => { | ||
this.doctorOrConditionList = doctorOrConditionList; | ||
this.cfpLoadingBar.complete(); | ||
}).catch(() => { | ||
this.cfpLoadingBar.complete(); | ||
}) | ||
@@ -104,2 +110,2 @@ } | ||
export default appointmenFinderController; | ||
export default appointmenFinderController; |
@@ -6,2 +6,11 @@ import moment from 'moment'; | ||
this.doctorlistPaginated = this.doctorListCopy.slice(0, this.elementsForPage); | ||
this.onChangeDate({ | ||
values: [ | ||
moment(new Date(new Date().setDate(new Date().getDate() + 0))), | ||
moment(new Date(new Date().setDate(new Date().getDate() + 1))), | ||
moment(new Date(new Date().setDate(new Date().getDate() + 2))), | ||
] | ||
}); | ||
} | ||
@@ -14,2 +23,9 @@ $onChanges(changes) { | ||
this.doctorlistPaginated = this.doctorListCopy.slice(0, this.elementsForPage); | ||
this.onChangeDate({ | ||
values: [ | ||
moment(new Date(new Date().setDate(new Date().getDate() + 0))).format('YYYY-MM-DD'), | ||
moment(new Date(new Date().setDate(new Date().getDate() + 1))).format('YYYY-MM-DD'), | ||
moment(new Date(new Date().setDate(new Date().getDate() + 2))).format('YYYY-MM-DD'), | ||
] | ||
}); | ||
} | ||
@@ -237,3 +253,3 @@ if (changes.doctorListFilter) { | ||
if (this.doctorListFilter.selectedHealthIssue !== 0) { | ||
if (this.doctorListFilter.selectedHealthIssue !== 'any') { | ||
this.doctorListCopy = [...this.filterByHealthIssue(this.doctorListCopy, this.doctorListFilter.selectedHealthIssue)]; | ||
@@ -240,0 +256,0 @@ } |
@@ -44,3 +44,4 @@ import AngularApollo from "angular1-apollo"; | ||
import appointmentFinderService from './app/components/appointment-finder/appointment-finder.service'; | ||
// import appointmentFinderService from './app/components/appointment-finder/appointment-finder.service'; | ||
import appointmentFinderService from './app/components/appointment-finder/appointment-finder-graphql.service'; | ||
@@ -78,3 +79,3 @@ let appModule = angular.module('', ['autoCompleteModule', 'angular-loading-bar', AngularApollo]) | ||
.config((cfpLoadingBarProvider) => { | ||
cfpLoadingBarProvider.includeSpinner = true; | ||
cfpLoadingBarProvider.includeSpinner = false; | ||
}) | ||
@@ -84,3 +85,4 @@ .config(apolloProvider => { | ||
link: new HttpLink({ | ||
uri: "http://localhost:4000/graphql" | ||
// uri: "http://localhost:4000/graphql" | ||
uri: "https://fr-healthcare-api.herokuapp.com/graphql" | ||
}), | ||
@@ -87,0 +89,0 @@ cache: new InMemoryCache() |
const doctorListFilter = { | ||
problem: [{ | ||
id: 0, | ||
id: 'any', | ||
name: "All Health Issues" | ||
@@ -44,3 +44,3 @@ }, | ||
], | ||
selectedHealthIssue: 0, | ||
selectedHealthIssue: 'any', | ||
selectedGender: 'any', | ||
@@ -47,0 +47,0 @@ selectedDay: 'any', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
950252
27476
0