-
-
Bonjour,
Sur un formulaire que j’ai adapté je n’ai aucun soucis dans les contrôles avec FormStudio. Par contre une fois chargé, j’ai cette erreur :
Controller : Fiche
Action : CreateSystem.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail] : La méthode ou l’opération n’est pas implémentée. (le détail de l’erreur est égal à ExceptionDetail, probablement créé par IncludeExceptionDetailInFaults=True, dont la valeur est :
System.NotImplementedException: La méthode ou l’opération n’est pas implémentée.Server stack trace:
à Forms.Modules.CHPD.Compte_rendu.Observations_CHPD.Model_Observations_medicales.RefreshObservations(Boolean v) dans s:\Informatique\Docs cell Info\01_Développement_Easily\sources\CHPD\Project\Compte_rendu\Observations_CHPD\Observations_medicales.cs:ligne 116
à Forms.Modules.CHPD.Compte_rendu.Observations_CHPD.Model_Observations_medicales.OnCreate(DataNode parameters) dans s:\Informatique\Docs cell Info\01_Développement_Easily\sources\CHPD\Project\Compte_rendu\Observations_CHPD\Observations_medicales.cs:ligne 109
à Forms.Module.Common.EditionContext.OnCreate(ObjectNode parameters) dans C:\WS\Easily_root\Dominho\V05.03.00.00\Maint\Sources\Projects\Forms.Module.Common\EditionContext.cs:ligne 2513
à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args…). -
J’ajoute sur même demande : un problème sur un score
Controller : Fiche
Action : CreateSystem.ServiceModel.FaultException
1[System.ServiceModel.ExceptionDetail] : Un objet qui autorise la valeur Null doit posséder une valeur. (le détail de l’erreur est égal à ExceptionDetail, probablement créé par IncludeExceptionDetailInFaults=True, dont la valeur est :
System.InvalidOperationException: Un objet qui autorise la valeur Null doit posséder une valeur.Server stack trace:
à System.Nullable1.get_Value()
à Forms.Modules.CHPD.scores.FARR.Model_FARR.RafraichirHistorique(IExecutionContext context) dans s:\Informatique\Docs cell Info\01_Développement_Easily\sources\CHPD\Project\scores\FARR\FARR.cs:ligne 36
à Forms.Modules.CHPD.scores.FARR.Model_FARR.OnCreate(DataNode parameters) dans s:\Informatique\Docs cell Info\01_Développement_Easily\sources\CHPD\Project\scores\FARR\FARR.cs:ligne 15
à Forms.Module.Common.EditionContext.OnCreate(ObjectNode parameters) dans C:\WS\Easily_root\Dominho\V05.03.00.00\Maint\Sources\Projects\Forms.Module.Common\EditionContext.cs:ligne 2513
à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
à System.Runtime.Remoting.Messaging.Stack…). -
Cette erreur sur FARR, je génère la même erreur pour le score wood modifié mais uniquement sur l’environnement de production pas sur l’environnement de test.
Merci.
-
Pour les observations, je me suis planté de fichier source.
Merci d’avance,
-
using System.Linq;
using Forms.Module.Contracts;
using System;
using System.Collections.Generic;
using Forms.Module.Contracts.Query;
using Forms.Modules.CHPD.Compte_rendu.Observations_CHPD.Inclusions;
using Forms.Modules.CHPD.Compte_rendu.Nomenclature;
using System.Text;
using Forms.Module.Contracts.Services.Easily;
using Forms.Module.Common;
using Forms.Module.Common.Nomenclature;
using Forms.Module.Common.Model;namespace Forms.Modules.CHPD.Compte_rendu.Observations_CHPD
{
public class Model_Observations_medicales : global::Forms.Modules.CHPD.Compte_rendu.Observations_CHPD.ModelBase_Observations_medicales
{
protected override void OnValidate(ActionType actionType)
{
this.texte_date_courante.Value =
“Version du ”
+ DateTime.Now.ToString(“dd/MM/yyyy à HH:mm”)
;
}
public Model_Observations_medicales(global::Forms.Module.Common.EditionContext context)
: base(context)
{
}#region Variables
bool HasObservations
{
get
{
var hasMots = mots_suivis.Items != null && mots_suivis.Items.Any();
var hasConsultations = consultations.Items != null && consultations.Items.Any();
var hasHospitalisations = hospitalisations.Items != null && hospitalisations.Items.Any();
var hasCROs = CROs.Items != null && CROs.Items.Any();
var hasHospitReglementaire = this.hospitalisations_reglementaires.Items != null && hospitalisations_reglementaires.Items.Any();
return hasMots || hasConsultations || hasHospitalisations || hasCROs || hasHospitReglementaire;
}
}// Dico des intervenants à charger (sinon l’intervenant n’est pas bien mis à jour dans l’affichage)
//Dictionary<int, Forms.Module.Contracts.Services.Easily.Intervenant> intervenants;
IEnumerable<Model_Intervenants> AllIntervenants
{
get
{
if (intervenants.Items != null && intervenants.Items.Any())
{
foreach (var item in intervenants.Items)
{
yield return item;
}
}
}
}
IEnumerable<Model_Observation> AllObservations
{
get
{
if (mots_suivis.Items != null && mots_suivis.Items.Any())
{
foreach (var item in mots_suivis.Items)
{
yield return item;
}
}
if (consultations.Items != null && consultations.Items.Any())
{
foreach (var item in consultations.Items)
{
yield return item;
}
}
if (hospitalisations.Items != null && hospitalisations.Items.Any())
{
foreach (var item in hospitalisations.Items)
{
yield return item;
}
}
if (CROs.Items != null && CROs.Items.Any())
{
foreach (var item in CROs.Items)
{
yield return item;
}
}
if (this.hospitalisations_reglementaires.Items != null && this.hospitalisations_reglementaires.Items.Any())
{
foreach (var item in this.hospitalisations_reglementaires.Items)
{
yield return item;
}
}
}
}
#endregion#region Création et modification
public override void OnCreate(Module.Contracts.DataNode parameters)
{
//S’il n’y a pas déjà une fiche pour ce patient/CR
if (!RecupIdFicheExistante())
{
RefreshObservations(true);
LoadFiltres();
}
}private void RefreshObservations(bool v)
{
throw new NotImplementedException();
}//A la création, on vérifie s’il n’y a pas déjà une fiche existante
//pour patient / CR courants
private bool RecupIdFicheExistante()
{
var ficheExistante = ModuleAPI.DominhoService.SelectForm<Observations_medicales>(
Observations_medicales.PatientId_field == EditionContext.ContextData.PatientId &
Observations_medicales.CentreResponsabiliteCode_field == EditionContext.ContextData.ResponsabilityCenterCode,
new QueryLoadSettings() { LimitToCurrentSpecialityCode = true},
Observations_medicales.DateCreation_field.Descending);//Si fiche existe déjà : alerte et récupération de l’id de cette fiche
if (ficheExistante != null)
{
this.alerte.Value = true;
this.observation_existante_id.Value = ficheExistante.Id;}
else
{
this.alerte.Value = false;
this.observation_existante_id.Value = null;
}
return this.alerte.Value;
}public override void OnEdit()
{
InitMotSuiviId();
RefreshObservations(true);
LoadFiltres();
RefreshAllCreatorIntv();if(this.intervenants.Items != null && this.intervenants.Items.Any())
{
var existingIntervenant = this.intervenants.Items.FirstOrDefault(i => i.intervenant_id.Value == this.intervenant_id.Value);
if (existingIntervenant != null)
{
this.intervenant_selectionne.Value = this.intervenants.Items.IndexOf(existingIntervenant);
}
}if(this.type_observations.Items != null && this.type_observations.Items.Any())
{
var existingType = this.type_observations.Items.FirstOrDefault(t => t.nom.Value == this.type_observation.Value);
if (existingType != null)
{
this.cle_type_observation.Value = this.type_observations.Items.IndexOf(existingType);
}
}
FilterObservations(this.observations, this.intervenant_id.Value ?? -1, this.type_observation.Value);
}private void RefreshAllCreatorIntv()
{
if (this.mots_suivis != null && this.mots_suivis.Items.Count > 0)
{
int[] _allCreatorIntvId = this.mots_suivis
.Items
.Where(m => m.intv_id_createur.Value.HasValue)
.Select(m => m.intv_id_createur.Value.Value)
.ToArray();var _allCreatorIntv = ModuleAPI.EasilyService
.GetIntervenants(_allCreatorIntvId);if (_allCreatorIntv != null)
{
foreach (var mot in this.mots_suivis.Items)
{
if (mot.intv_id_createur.Value.HasValue)
{
var _intvMot = _allCreatorIntv.FirstOrDefault(c => c.Id == mot.intv_id_createur.Value.Value);
if (_intvMot != null)
{
mot.nom_intv_createur.Value = _intvMot.Nom;
mot.prenom_intv_createur.Value = _intvMot.Prenom;
}
}
}
}
}
}#endregion
#region Chargement des filtres
/// <summary>
/// Chargement des filtres
/// Chargement des intervenants
/// –> inclusion multiple correspondant à la liste des intervenants saisis sur les
/// observations
/// </summary>
private void LoadFiltres()
{
intervenants.Items.Clear();if (HasObservations)
{
foreach (var observation in AllObservations)
{
//Filtre sur les intervenants
if (observation.intervenant_id.Value.HasValue)
{
var intervComp = new IntervenantComparer(EditionContext);
var intervenantACreer = intervComp
.FormatIntervenant(observation.intervenant.Value, observation.intervenant_id.Value, observation.intervenant_txt.Value);
//Si l’intervenant n’existe pas déjà dans la liste
//Ajout de l’intervenant courant dans la liste
if (!AllIntervenants.Contains(intervenantACreer, intervComp))
{
//Ajout dans la nomenclature sur inclusion multiple “intervenants”
intervenants.Items.Add(intervenantACreer);
}
}
intervenants.Items.OrderBy(i => i.intervenant_txt);}
}this.type_observations.Items.Clear();
if (this.observations != null && this.observations.Items.Count > 0)
{
foreach (var mot in this.observations.Items)
{
if (mot.type_observation != null
&& mot.type_observation.Value != null
&& this.type_observations.Items.FirstOrDefault(t => t.nom.Value == mot.type_observation.Value.Title) == null)
{
if (mot.type_observation.Value.Id == Nomenclature.Type_Observation.Item_fdd4ffaaf419428da5227e52e667e475.Id)
{
if (mot.type_mot_suivi != null
&& mot.type_mot_suivi.Value != null
&& this.type_observations.Items.FirstOrDefault(t => t.nom.Value == mot.type_mot_suivi.Value.Title) == null)
{
var _newType = new Inclusions.Model_Liste_Type_Observation(EditionContext);
_newType.nom.Value = mot.type_mot_suivi.Value.Title;
this.type_observations.Items.Add(_newType);
}
}
else
{
var _newType = new Inclusions.Model_Liste_Type_Observation(EditionContext);
_newType.nom.Value = mot.type_observation.Value.Title;
this.type_observations.Items.Add(_newType);
}
}
}
}
}
#endregion#region Chargement des observations
protected override void RafraichirListeObservations(IExecutionContext context, bool? reload_fiches)
{
if (reload_fiches.HasValue)
RefreshObservations(reload_fiches.Value);
else
RefreshObservations(false);LoadFiltres();
}#region Chargement des observations filtrées
protected override void AfficherListeObservationsFiltree(IExecutionContext context, int? intervenant_id, string type_observation)
{
FilterObservations(this.observations, intervenant_id, type_observation);
}private void FilterObservations(MultipleInsertModelFieldEditor<Model_Observation> insert, int? intervenant_id, string type_observation)
{
insert.Items.Clear();
IEnumerable<Model_Observation> listeFiltre = new List<Model_Observation>();
if (HasObservations)
{
// si filtres à null, on recharge toutes les inclusions
if ((intervenant_id == -1 || !intervenant_id.HasValue) && string.IsNullOrEmpty(type_observation))
{
listeFiltre = AllObservations.OrderByDescending(o => o.date_observation.Value);
}
else
{
//Si on a sélectionné un intervenant
if (intervenant_id >= 0)
{
//Si on a sélectionné un type d’observation
if (!string.IsNullOrEmpty(type_observation))
{
listeFiltre = AllObservations
.Where(o => o.intervenant_id.Value == intervenant_id
&& (o.type_observation.Value != null && o.type_observation.Value.Title.Equals(type_observation)
|| (o.type_mot_suivi.Value != null && o.type_mot_suivi.Value.Title.Equals(type_observation))))
.OrderBy(o => o.date_observation.Value);
}
else
{
listeFiltre = AllObservations
.Where(o => o.intervenant_id.Value == intervenant_id)
.OrderBy(o => o.date_observation.Value);}
}
//Si on n’a pas sélectionné d’intervenant -> filtre sur le type d’observation seulement
else
{
listeFiltre = AllObservations
.Where(o => (o.type_observation.Value != null && o.type_observation.Value.Title.Equals(type_observation))
|| (o.type_mot_suivi.Value != null && o.type_mot_suivi.Value.Title.Equals(type_observation)))
.OrderBy(o => o.date_observation.Value);}
}
int i = 0;//Insertion des éléments filtrés dans l’inclusion “observations”
foreach (var observation in listeFiltre)
{
observation.global_index.Value = i;
insert.Items.Add(observation);
i++;
}
}
}#endregion
#region Création des mots de suivi
protected override void CreationMot(IExecutionContext context, string ModeFermeture)
{
if (ModeFermeture == “Yes”)
{
if (this.mot_suivi_date.Value.HasValue
&& this.mot_suivi_type_mot.Value != null
&& this.mot_suivi_intervenant_id.Value.HasValue)
{
//Données
var _newMot = new Observations_CHPD.Inclusions.Model_Observation(EditionContext);
_newMot.date_observation.Value = this.mot_suivi_date.Value;
_newMot.texte_observation.Value = this.mot_suivi_texte.Value;
_newMot.intervenant.Value = this.mot_suivi_intervenant.Value;
_newMot.intervenant_id.Value = this.mot_suivi_intervenant_id.Value;
_newMot.intervenant_txt.Value = this.mot_suivi_intervenant_txt.Value;
_newMot.titre_observation.Value =
this.mot_suivi_type_mot.Value.Title
+ ” du ”
+ this.mot_suivi_date.Value.Value.ToString(“dd/MM/yyyy”)
+ ” – ”
+ this.mot_suivi_intervenant_txt;
_newMot.type_intervenant_mot_suivi.Value = this.mot_suivi_type_intervenant.Value;
_newMot.type_intervenant_autres_mot_suivi.Value = this.mot_suivi_type_intervenant_autres.Value;
_newMot.type_mot_suivi.Value = this.mot_suivi_type_mot.Value;
_newMot.mot_suivi_id.Value = this.mots_suivis.Items.Count;
_newMot.type_observation.Value = EditionContext.GetNomenclatureItem(Nomenclature.Type_Observation.Item_fdd4ffaaf419428da5227e52e667e475.Id);//Métadonnées
_newMot.intv_id_createur.Value = EditionContext.ContextData.UserId;
var _intv = ModuleAPI.EasilyService
.GetIntervenants(new int[]{ EditionContext.ContextData.UserId })
.FirstOrDefault();
_newMot.nom_intv_createur.Value = _intv.Nom;
_newMot.prenom_intv_createur.Value = _intv.Prenom;
_newMot.date_modification.Value = DateTime.Now;
_newMot.heure_modification.Value = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);this.mots_suivis.Items.Add(_newMot);
RafraichirListeObservations(null,false);
}
}
}#endregion
#region Edition des mots de suivi
/// <summary>
/// Assignation d’un id aux mots de suivi pour pouvoir les éditer via l’insertion affichée
/// </summary>
private void InitMotSuiviId()
{
if (mots_suivis.Items != null && mots_suivis.Items.Any())
{
for (int i = 0; i < mots_suivis.Items.Count; i++)
{
mots_suivis.Items[i].mot_suivi_id.Value = i;
}
}
}protected override void EditCurrentMotSuivi(IExecutionContext context, string ModeFermeture)
{
if (ModeFermeture == “Yes”)
{
if (mot_suivi_id.Value.HasValue)
{
//MAJ valeurs inclusion persistante
var item = mots_suivis.Items.FirstOrDefault(m => m.mot_suivi_id.Value == mot_suivi_id.Value);
if (item != null)
{
item.date_observation.Value = mot_suivi_date.Value;
item.texte_observation.Value = mot_suivi_texte.Value;
item.type_mot_suivi.Value = mot_suivi_type_mot.Value;
item.intervenant.Value = mot_suivi_intervenant.Value;
item.intervenant_id.Value = mot_suivi_intervenant_id.Value;
item.intervenant_txt.Value = mot_suivi_intervenant_txt.Value;
item.type_intervenant_mot_suivi.Value = mot_suivi_type_intervenant.Value;
item.type_intervenant_autres_mot_suivi.Value = mot_suivi_type_intervenant_autres.Value;
item.date_maj_mot_suivi.Value = DateTime.Now;
//Construction du titre à afficher
var titre = new StringBuilder();
var texteType = mot_suivi_type_mot.Value.Title;
titre.Append(texteType);
titre.Append(” du “);
titre.Append(item.date_observation.Value.Value.ToShortDateString());
titre.Append(” – “);
titre.Append(item.intervenant_txt.Value);//Métadonnées
if (!item.intv_id_createur.Value.HasValue)
{
item.intv_id_createur.Value = EditionContext.ContextData.UserId;
var _intv = ModuleAPI.EasilyService
.GetIntervenants(new int[] { EditionContext.ContextData.UserId })
.FirstOrDefault();
item.nom_intv_createur.Value = _intv.Nom;
item.prenom_intv_createur.Value = _intv.Prenom;
}
item.date_modification.Value = DateTime.Now;
item.heure_modification.Value = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);item.titre_observation.Value = titre.ToString();
RefreshObservations(false);
}if(liste_infos_hopit_reg.Items != null && liste_infos_hopit_reg.Items.Any())
{
var recapitulatif = liste_infos_hopit_reg.Items.FirstOrDefault(m => m.mot_suivi_id.Value == mot_suivi_id.Value);
if(recapitulatif != null)
{
recapitulatif.mot_suivi_date.Value = mot_suivi_date.Value;
recapitulatif.mot_suivi_type_mot.Value = mot_suivi_type_mot.Value.Title;
recapitulatif.mot_suivi_intervenant_txt.Value = mot_suivi_intervenant_txt.Value;
recapitulatif.mot_suivi_type_intervenant.Value = mot_suivi_type_intervenant.Value != null ? mot_suivi_type_intervenant.Value.Title : string.Empty;
recapitulatif.mot_suivi_type_intervenant_autres.Value = mot_suivi_type_intervenant_autres.Value;
recapitulatif.mot_suivi_texte.Value = mot_suivi_texte.Value;
}
}
}
}
}#endregion
}
/// <summary>
/// Comparateur spécialisé pour les intervenants ajoutés
/// dans l’inclusion multiple “Intervenants” (filtre)
/// </summary>
class IntervenantComparer : IEqualityComparer<Model_Intervenants>
{
private EditionContext EditionContext;public IntervenantComparer(EditionContext EditionContext)
{
this.EditionContext = EditionContext;
}/// <summary>
/// Transforme un item de nomenclature “Médecins”
/// en item de l’inclusion multiple “Intervenants”
/// </summary>
/// <param name=”interv”>item de nomenclature “Médecins”</param>
/// <param name=”interv_int”>référence de l’intervenant</param>
/// <param name=”interv_txt”>libellé de l’intervenant</param>
/// <returns></returns>
public Model_Intervenants FormatIntervenant(NomenclatureItemBase interv, int? interv_int, string interv_txt) {
Model_Intervenants newIntervFiltre = new Model_Intervenants(EditionContext);
newIntervFiltre.intervenant.Value = interv;
newIntervFiltre.intervenant_id.Value = interv_int;
newIntervFiltre.intervenant_txt.Value = interv_txt;return newIntervFiltre;
}
bool IEqualityComparer<Model_Intervenants>.Equals(Model_Intervenants x, Model_Intervenants y)
{
if (x == null || y == null)
{
return false;
}
return x.intervenant_id.Value == y.intervenant_id.Value;
}int IEqualityComparer<Model_Intervenants>.GetHashCode(Model_Intervenants obj)
{
if (obj == null) return 0;
int hashIntervenantId = obj.intervenant_id.GetHashCode();
return hashIntervenantId;}
}}
#endregion
-
using System.Linq;
namespace Forms.Modules.CHPD.scores.FARR
{
public class Model_FARR : global::Forms.Modules.CHPD.scores.FARR.ModelBase_FARR
{
public Model_FARR(global::Forms.Module.Common.EditionContext context)
: base(context)
{
}
//Appel de la methode de cr�aation de l’insertion
public override void OnCreate(Module.Contracts.DataNode parameters)
{
entete.Item.OnCreate(parameters);
RafraichirHistorique(null);
}public override void OnEdit()
{
RafraichirHistorique(null);
}//Bouton d’historique des fiches
protected override void RafraichirHistorique(Module.Contracts.IExecutionContext context)
{
this.historique.Items.Clear();
var historique= ModuleAPI.DominhoService.SelectForms<FARR>
(FARR.PatientId_field == EditionContext.ContextData.PatientId, new Module.Contracts.Query.QueryLoadSettings(){LimitToCurrentSpeciality = false,MaxResult = int.MaxValue}
, FARR.DateCreation_field.Descending);
if (historique!= null && historique.Count() > 0)
{
foreach (var item in historique.OrderBy(i => i.DateCreation))
{
var ligneHisto = new Forms.Modules.CHPD.Entete_scores.Model_Historique(EditionContext);
ligneHisto.id_fiche.Value = item.Id;
ligneHisto.score.Value = item.score.Value.ToString() + ” /10″;
ligneHisto.score_graphique_1.Value = item.score.HasValue ? item.score.Value : 0;
ligneHisto.date_eval_historique.Value = item.entete.date_evaluation;
if (item.entete.intervenant.HasValue)
{
var intervenants =
ModuleAPI.EasilyService.GetIntervenants(
new int[] { item.entete.intervenant.Value });
if (intervenants != null && intervenants.Length == 1) ligneHisto.intervenant_historique.Value = intervenants[0].Nom + ” ” + intervenants[0].Prenom;
}
else
{
ligneHisto.intervenant_historique.Value = “???”;
}
this.historique.Items.Add(ligneHisto);
}
}
}}
} -
Comme les fichiers sources ne passaient je les ai copié collé ici.
-
Du coup, on relançant easily ca a corrigé. Il se peut que certains formulaires se soient mal installé.
-
The forum ‘Problèmes rencontrés avec FormsStudio’ is closed to new topics and replies.